/*
 * nld-mentor.css — leader↔member mentoring conversations.
 *
 * Built on the app's own tokens (--primary-rgb, --text-main, --s-*) rather
 * than fixed colours, so it inherits whichever shell it is rendered inside
 * and does not become another surface the theme migration has to chase.
 */

#mentor-panel { display: none; position: fixed; inset: 0; z-index: 90; }
#mentor-panel.open { display: block; }

.mentor-backdrop { position: absolute; inset: 0; background: rgba(20, 32, 24, 0.55); }

.mentor-sheet {
    position: absolute; inset: auto 0 0 0;
    max-height: 86vh; display: flex; flex-direction: column;
    background: var(--surface, #fff);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 40px rgba(20, 32, 24, 0.22);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 680px) {
    .mentor-sheet {
        inset: 50% auto auto 50%; transform: translate(-50%, -50%);
        width: 560px; border-radius: 18px; max-height: 78vh;
    }
}

.mentor-head {
    display: flex; align-items: center; gap: var(--s-8, 8px);
    padding: var(--s-14, 14px) var(--s-16, 16px);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.12);
}
.mentor-title {
    flex: 1; font-weight: 700; font-size: 15px; color: var(--text-main);
    display: flex; align-items: center; gap: var(--s-10, 10px);
}
.mentor-back, .mentor-x {
    background: none; border: none; cursor: pointer;
    font-size: 17px; color: var(--text-muted, #667);
    padding: 4px 8px; border-radius: 8px;
}
.mentor-back:hover, .mentor-x:hover { background: rgba(var(--primary-rgb), 0.08); }

/* Report and End live here, in permanent view, at the same weight as
   everything else. A safety control behind a menu is one that gets used after
   the harm rather than during it. */
.mentor-guards { display: flex; gap: 6px; }
.mentor-guards button {
    font-size: 11px; font-weight: 600; cursor: pointer;
    padding: 4px 10px; border-radius: 999px;
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    background: none; color: var(--text-muted, #667);
}
.mentor-guards button:hover { border-color: rgba(var(--primary-rgb), 0.5); color: var(--text-main); }

.mentor-body {
    flex: 1; overflow-y: auto; padding: var(--s-16, 16px);
    display: flex; flex-direction: column; gap: var(--s-10, 10px);
}
.mentor-foot {
    padding: var(--s-12, 12px) var(--s-16, 16px);
    border-top: 1px solid rgba(var(--primary-rgb), 0.12);
    display: flex; gap: var(--s-8, 8px);
}
.mentor-foot form { display: flex; gap: var(--s-8, 8px); width: 100%; }
.mentor-foot textarea {
    flex: 1; resize: none; font: inherit; font-size: 14px;
    padding: 10px 12px; border-radius: 12px;
    border: 1.5px solid rgba(var(--primary-rgb), 0.2);
    background: var(--surface, #fff); color: var(--text-main);
}
.mentor-foot textarea:focus { outline: none; border-color: rgba(var(--primary-rgb), 0.45); }
.mentor-foot button {
    border: none; border-radius: 12px; cursor: pointer;
    padding: 10px 18px; font-weight: 700; font-size: 14px;
    background: rgb(var(--primary-rgb)); color: #fff;
}

.mentor-row {
    display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s-10, 10px);
    width: 100%; text-align: left; cursor: pointer;
    padding: var(--s-12, 12px) var(--s-14, 14px);
    border-radius: 12px; border: 1px solid rgba(var(--primary-rgb), 0.14);
    background: rgba(var(--primary-rgb), 0.03);
}
.mentor-row:hover { border-color: rgba(var(--primary-rgb), 0.3); }
/* An invitation waiting on YOU is the only row that needs an answer, so it is
   the only one that gets emphasis. */
.mentor-row.needs-you { border-color: rgba(var(--gold-rgb, 201, 168, 76), 0.55); background: rgba(var(--gold-rgb, 201, 168, 76), 0.08); }
.mentor-row-name { font-weight: 700; font-size: 14.5px; color: var(--text-main); }
.mentor-row-sub { grid-column: 1; font-size: 12px; color: var(--text-muted, #778); }
.mentor-status { grid-row: 1 / span 2; align-self: center; font-size: 11px; color: var(--text-muted, #778); }
.mentor-status.s-reported { color: #b4553f; font-weight: 600; }

.mentor-msg { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.mentor-msg.mine { align-self: flex-end; background: rgb(var(--primary-rgb)); color: #fff; border-bottom-right-radius: 5px; }
.mentor-msg.theirs { align-self: flex-start; background: rgba(var(--primary-rgb), 0.08); color: var(--text-main); border-bottom-left-radius: 5px; }
.mentor-msg-time { font-size: 10.5px; opacity: 0.6; margin-top: 3px; }

.mentor-invite blockquote {
    margin: var(--s-10, 10px) 0; padding: var(--s-10, 10px) var(--s-14, 14px);
    border-left: 3px solid rgba(var(--primary-rgb), 0.35);
    background: rgba(var(--primary-rgb), 0.05); border-radius: 0 10px 10px 0;
    font-style: italic; color: var(--text-main);
}
.mentor-accept, .mentor-decline {
    flex: 1; border-radius: 12px; cursor: pointer; padding: 11px;
    font-weight: 700; font-size: 14px; border: none;
}
.mentor-accept { background: rgb(var(--primary-rgb)); color: #fff; }
.mentor-decline { background: none; color: var(--text-muted, #667); border: 1.5px solid rgba(var(--primary-rgb), 0.22); }

.mentor-muted { color: var(--text-muted, #778); font-size: 14px; text-align: center; padding: var(--s-16, 16px) 0; }
.mentor-fine  { color: var(--text-muted, #889); font-size: 12.5px; line-height: 1.55; }
.mentor-error { color: #b4553f; font-size: 14px; text-align: center; }
