/* ============================================================
   E20 Partner LMS — styles (extends e20.css + portal.css tokens)
   ============================================================ */

/* ---- auth pages (register / login share .gate) ---- */
.gate-card.wide { max-width: 540px; }
.gate-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gate-field select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; font-family: var(--sans); font-size: 16px; color: var(--ink); cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23858b91' stroke-width='2'%3E%3Cpath d='M2 5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.gate-field select:focus { outline: none; border-color: var(--accent); }
.gate-ok { display: none; text-align: center; }
.gate-ok .ok-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.gate-ok .ok-mark svg { width: 30px; height: 30px; stroke: var(--accent); fill: none; stroke-width: 2.4; }
.gate-ok h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin-bottom: 10px; }
.gate-ok p { font-size: 15px; color: var(--ink-2); margin-bottom: 24px; }
.gate-switch { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-3); text-align: center; }
.gate-switch a { color: var(--accent); font-weight: 600; }
.gate-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

/* role picker */
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-opt { position: relative; }
.role-opt input { position: absolute; opacity: 0; pointer-events: none; }
.role-opt label { display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: .18s; }
.role-opt label b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.role-opt label span { font-size: 12px; color: var(--ink-3); }
.role-opt label:hover { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
.role-opt input:checked + label { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 7%, transparent); }

/* ---- hub: course rail + role chip ---- */
.pn-role { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.brand-chip { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 100px; border: 1px solid var(--line); color: var(--ink-2); }
.brand-chip.e20 { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }

.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.course-card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; transition: .25s; }
.course-card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -34px rgba(20,40,60,.45); }
.course-top { padding: 22px 24px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.course-cat { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.course-cert { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: #946200; background: #fbf0d6; border: 1px solid #f0dca6; border-radius: 100px; padding: 4px 9px; }
.course-card h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.1; margin: 12px 24px 8px; }
.course-card p { font-size: 14px; color: var(--ink-2); line-height: 1.5; margin: 0 24px 18px; }
.course-foot { margin-top: auto; padding: 16px 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.course-foot .cf-meta { font-size: 12.5px; color: var(--ink-3); }
.progress-track { flex: 1; height: 7px; background: var(--bg-2); border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 5px; transition: width .5s; }
.progress-pct { font-size: 12.5px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.course-done { font-size: 12px; font-weight: 700; color: #1f9d57; display: flex; align-items: center; gap: 5px; }

/* ---- course player ---- */
.player { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: start; }
.player-side { position: sticky; top: 88px; align-self: start; }
.player-side .ps-back { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 18px; }
.player-side .ps-back:hover { color: var(--accent); }
.player-side h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.1; margin-bottom: 8px; }
.player-prog { font-size: 12.5px; color: var(--ink-3); margin-bottom: 18px; }
.mod-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mod-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; cursor: pointer; transition: .15s; border: 1px solid transparent; }
.mod-item:hover { background: var(--bg-2); }
.mod-item.active { background: color-mix(in oklab, var(--accent) 8%, transparent); border-color: color-mix(in oklab, var(--accent) 30%, var(--line)); }
.mod-item.locked { opacity: .5; cursor: not-allowed; }
.mod-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-2); display: flex; align-items: center; justify-content: center; flex: none; }
.mod-ic svg { width: 15px; height: 15px; stroke: var(--ink-3); fill: none; stroke-width: 2; }
.mod-item.done .mod-ic { background: #e3f5ec; }
.mod-item.done .mod-ic svg { stroke: #1f9d57; }
.mod-item.active .mod-ic { background: var(--accent); }
.mod-item.active .mod-ic svg { stroke: #fff; }
.mod-meta { min-width: 0; }
.mod-meta b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.mod-meta span { font-size: 11.5px; color: var(--ink-3); text-transform: capitalize; }

.player-main { min-width: 0; padding-bottom: 60px; }
.pm-tag { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.player-main h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px,4vw,40px); line-height: 1.06; margin: 10px 0 20px; }
.video-embed { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #000; margin-bottom: 24px; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.module-body p { font-size: 16.5px; line-height: 1.7; color: var(--ink-2); margin-bottom: 14px; max-width: 46em; }
.module-actions { margin-top: 30px; display: flex; gap: 12px; align-items: center; }

/* quiz */
.quiz { max-width: 640px; }
.quiz-q { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 24px 26px; margin-bottom: 16px; }
.quiz-q .qn { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.quiz-q h3 { font-size: 18px; font-weight: 600; margin: 8px 0 16px; line-height: 1.35; }
.quiz-opt { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; margin-bottom: 9px; transition: .15s; font-size: 15px; }
.quiz-opt:hover { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
.quiz-opt input { accent-color: var(--accent); width: 18px; height: 18px; }
.quiz-opt.correct { border-color: #1f9d57; background: #eaf7f0; }
.quiz-opt.wrong { border-color: #c0432f; background: #fbeae6; }
.quiz-result { padding: 18px 22px; border-radius: 12px; margin: 18px 0; font-size: 15.5px; font-weight: 600; }
.quiz-result.pass { background: #eaf7f0; color: #14613a; border: 1px solid #b6e2cb; }
.quiz-result.fail { background: #fbeae6; color: #8a2a18; border: 1px solid #f0c4ba; }

/* certificate */
.cert { max-width: 720px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 6px; }
.cert-inner { border: 2px solid var(--accent); border-radius: 14px; padding: 54px 48px; text-align: center; background:
  radial-gradient(120% 80% at 50% -10%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 60%); }
.cert-inner img { height: 30px; margin-bottom: 26px; }
.cert-inner .ce { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.cert-inner h1 { font-family: var(--serif); font-weight: 400; font-size: 40px; margin: 14px 0 6px; }
.cert-inner .cn { font-family: var(--serif); font-size: 30px; color: var(--accent); margin: 18px 0; }
.cert-inner .cd { font-size: 14px; color: var(--ink-3); margin-top: 22px; }

/* ---- admin console ---- */
.adm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 28px; flex-wrap: wrap; }
.adm-tab { font-family: var(--sans); font-size: 14.5px; font-weight: 600; color: var(--ink-3); background: none; border: none; border-bottom: 2px solid transparent; padding: 12px 18px; cursor: pointer; margin-bottom: -1px; }
.adm-tab:hover { color: var(--ink); }
.adm-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.adm-panel { display: none; }
.adm-panel.active { display: block; }
.adm-count { display: inline-block; min-width: 18px; padding: 0 6px; height: 18px; line-height: 18px; text-align: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 100px; margin-left: 6px; }

.adm-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.adm-table th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.adm-table td { padding: 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.adm-table td b { color: var(--ink); }
.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 10px; border-radius: 100px; text-transform: uppercase; }
.pill.pending { background: #fbf0d6; color: #946200; }
.pill.approved { background: #e3f5ec; color: #14613a; }
.pill.disabled { background: #eceef0; color: #858b91; }
.btn-sm { font-family: var(--sans); font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; transition: .15s; }
.btn-sm:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-sm.approve { border-color: var(--accent); color: var(--accent); }
.btn-sm.approve:hover { background: var(--accent); color: #fff; }
.btn-sm.danger:hover { background: #c0432f; border-color: #c0432f; }

.adm-form { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 28px 30px; max-width: 720px; }
.adm-form .af-row { margin-bottom: 16px; }
.adm-form label { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 7px; }
.adm-form input, .adm-form textarea, .adm-form select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font-family: var(--sans); font-size: 15px; color: var(--ink);
}
.adm-form textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.adm-form input:focus, .adm-form textarea:focus, .adm-form select:focus { outline: none; border-color: var(--accent); }
.adm-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.adm-note { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.adm-saved { display: none; margin-top: 14px; font-size: 14px; font-weight: 600; color: #14613a; }
.module-builder { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.mb-row { display: flex; gap: 10px; align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.mb-row .mb-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); width: 52px; }
.mb-row b { flex: 1; font-weight: 600; color: var(--ink); }

/* multi-target checkbox grid */
.tgt-group { margin-top: 10px; }
.tgt-group + .tgt-group { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.tgt-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.tgt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tgt-chip { position: relative; }
.tgt-chip input { position: absolute; opacity: 0; pointer-events: none; }
.tgt-chip label { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: var(--bg); border: 1.5px solid var(--line); border-radius: 100px; padding: 8px 14px; cursor: pointer; transition: .15s; }
.tgt-chip label:hover { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
.tgt-chip input:checked + label { background: color-mix(in oklab, var(--accent) 10%, transparent); border-color: var(--accent); color: var(--accent); }
.tgt-chip input:disabled + label { opacity: .4; cursor: not-allowed; }

/* archive sub-tabs */
.sub-tabs { display: inline-flex; gap: 4px; background: var(--bg-2); border-radius: 100px; padding: 4px; margin-bottom: 18px; }
.sub-tab { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink-2); background: none; border: none; border-radius: 100px; padding: 7px 16px; cursor: pointer; }
.sub-tab.active { background: var(--paper); color: var(--accent); box-shadow: 0 2px 6px -3px rgba(20,40,60,.3); }
.ann.archived { opacity: .62; }

/* drag-and-drop module list */
.dnd-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.dnd-item { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: grab; transition: box-shadow .15s, border-color .15s, transform .12s; }
.dnd-item:hover { border-color: color-mix(in oklab, var(--accent) 35%, var(--line)); }
.dnd-item.dragging { opacity: .5; cursor: grabbing; }
.dnd-item.drag-over { border-color: var(--accent); box-shadow: 0 -2px 0 var(--accent) inset; }
.dnd-grip { display: flex; flex-direction: column; gap: 3px; flex: none; }
.dnd-grip span { width: 16px; height: 2px; border-radius: 2px; background: var(--ink-3); }
.dnd-num { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-2); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.dnd-type { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); width: 46px; flex: none; }
.dnd-item b { flex: 1; font-size: 14px; font-weight: 600; color: var(--ink); min-width: 0; }
.dnd-del { font-size: 12px; font-weight: 600; color: var(--ink-3); background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.dnd-del:hover { color: #c0432f; background: #fbeae6; }
.dnd-empty { font-size: 13.5px; color: var(--ink-3); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }
.course-pick { display: flex; flex-direction: column; gap: 8px; }
.course-pick-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; transition: .15s; }
.course-pick-row:hover { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
.course-pick-row.active { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 7%, transparent); }
.course-pick-row b { flex: 1; font-size: 15px; }
.course-pick-row span { font-size: 12.5px; color: var(--ink-3); }
.builder-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
.cover-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cover-opt { position: relative; width: 84px; height: 54px; border-radius: 9px; overflow: hidden; border: 2px solid var(--line); cursor: pointer; transition: .15s; }
.cover-opt img { width: 100%; height: 100%; object-fit: cover; }
.cover-opt.auto { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--ink-3); background: var(--bg-2); }
.cover-opt.active { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 30%, transparent); }
.dnd-edit { font-size: 12px; font-weight: 600; color: var(--accent); background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.dnd-edit:hover { background: color-mix(in oklab, var(--accent) 10%, transparent); }
.editing-banner { display: none; align-items: center; gap: 10px; background: color-mix(in oklab, var(--accent) 8%, transparent); border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--line)); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; color: var(--accent-2); font-weight: 600; }
@media (max-width: 1000px) { .builder-cols { grid-template-columns: 1fr; } }

/* ---- messaging ---- */
.chat { display: grid; grid-template-columns: 320px 1fr; gap: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--paper); height: calc(100vh - 150px); min-height: 520px; }
.chat-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-side-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.chat-side-head h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; }
.chat-new { font-size: 13px; font-weight: 600; color: #fff; background: var(--accent); border: none; border-radius: 100px; padding: 8px 14px; cursor: pointer; }
.chat-new:hover { background: var(--accent-2); }
.conv-list { overflow-y: auto; flex: 1; min-height: 0; }
.conv { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; border-bottom: 1px solid var(--line); transition: background .15s; }
.conv:hover { background: var(--bg-2); }
.conv.active { background: color-mix(in oklab, var(--accent) 8%, transparent); }
.conv-av { width: 42px; height: 42px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: #fff; background: var(--accent); }
.conv-av.group { background: var(--ink); }
.conv-main { min-width: 0; flex: 1; }
.conv-main b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-main span { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-empty { padding: 30px 20px; text-align: center; color: var(--ink-3); font-size: 14px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.chat-head .conv-av { width: 38px; height: 38px; font-size: 14px; }
.chat-head b { font-size: 16px; font-weight: 600; }
.chat-act { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; }
.chat-act:hover { border-color: var(--accent); }
.chat-act.danger:hover { border-color: #c0432f; color: #c0432f; }
.msg .msg-del { background: none; border: none; color: inherit; opacity: .7; font-size: 10.5px; cursor: pointer; text-decoration: underline; padding: 0; font-family: var(--sans); }
.msg .msg-del:hover { opacity: 1; }
.chat-head span { font-size: 12.5px; color: var(--ink-3); }
.chat-body { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); min-height: 0; }
.msg { max-width: 72%; padding: 11px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; }
.msg.them { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.msg .msg-who { font-size: 11.5px; font-weight: 700; color: var(--accent); margin-bottom: 3px; }
.msg .msg-time { font-size: 10.5px; opacity: .6; margin-top: 4px; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink-3); gap: 10px; text-align: center; padding: 30px; }
.chat-empty svg { width: 46px; height: 46px; stroke: var(--line-2, #c9ccd0); fill: none; stroke-width: 1.5; }
.chat-composer { border-top: 1px solid var(--line); padding: 14px 18px; display: flex; gap: 10px; align-items: flex-end; }
.chat-composer textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-family: var(--sans); font-size: 14.5px; color: var(--ink); max-height: 120px; min-height: 44px; }
.chat-composer textarea:focus { outline: none; border-color: var(--accent); }
.chat-send { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; }
.chat-send:hover { background: var(--accent-2); }
.chat-send svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2; }
.chat-send:disabled { opacity: .4; cursor: default; }

/* new-conversation modal */
.modal-bg { position: fixed; inset: 0; background: rgba(13,19,23,.55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.modal-bg.open { display: flex; }
.modal { background: var(--paper); border-radius: 18px; width: 100%; max-width: 480px; max-height: 86vh; overflow-y: auto; padding: 30px 32px; }
.modal h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin-bottom: 6px; }
.modal p { font-size: 14px; color: var(--ink-2); margin-bottom: 18px; }
.modal-tabs { display: inline-flex; gap: 4px; background: var(--bg-2); border-radius: 100px; padding: 4px; margin-bottom: 18px; }
.modal-tab { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink-2); background: none; border: none; border-radius: 100px; padding: 8px 16px; cursor: pointer; }
.modal-tab.active { background: var(--paper); color: var(--accent); box-shadow: 0 2px 6px -3px rgba(20,40,60,.3); }
.modal label { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); margin: 14px 0 8px; }
.modal input[type=text], .modal select { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-family: var(--sans); font-size: 15px; color: var(--ink); }
.modal input:focus, .modal select:focus { outline: none; border-color: var(--accent); }
.people-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.person { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.person:last-child { border-bottom: none; }
.person:hover { background: var(--bg-2); }
.person .conv-av { width: 34px; height: 34px; font-size: 13px; }
.person b { flex: 1; font-size: 14px; font-weight: 600; }
.person span { font-size: 12px; color: var(--ink-3); }
.person input { width: 18px; height: 18px; accent-color: var(--accent); }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-panel { display: none; }
.modal-panel.active { display: block; }

@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat-side { border-right: none; border-bottom: 1px solid var(--line); max-height: 240px; }
  .chat.viewing .chat-side { display: none; }
  .chat:not(.viewing) .chat-main { display: none; }
}

/* ---- profile ---- */
.profile-grid { display: grid; grid-template-columns: 320px 1fr; gap: 36px; align-items: start; }
.profile-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 30px; text-align: center; position: sticky; top: 88px; }
.profile-photo { position: relative; display: inline-block; }
.pp-img { width: 132px; height: 132px; border-radius: 50%; overflow: hidden; background: var(--accent); display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.pp-img img { width: 100%; height: 100%; object-fit: cover; }
.pp-init { color: #fff; font-size: 44px; font-weight: 700; }
.pp-upload { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; border: 1px solid var(--line); border-radius: 100px; padding: 7px 16px; transition: .15s; }
.pp-upload:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.profile-meta { margin-top: 20px; }
.profile-meta .brand-chip { margin-bottom: 12px; }
.profile-meta h1 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; }
.profile-meta .p-role { font-size: 14.5px; color: var(--accent); font-weight: 600; margin-top: 4px; }
.profile-meta .p-loc { font-size: 13.5px; color: var(--ink-3); margin-top: 4px; }
.cert-collection { display: grid; gap: 12px; }
.cert-badge { display: flex; align-items: center; gap: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; text-decoration: none; transition: .2s; }
.cert-badge:hover { transform: translateY(-3px); box-shadow: 0 20px 44px -32px rgba(20,40,60,.4); }
.cb-mark { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: flex; align-items: center; justify-content: center; flex: none; }
.cb-mark svg { width: 24px; height: 24px; }
.cb-body { flex: 1; }
.cb-body b { display: block; font-size: 16px; font-weight: 600; color: var(--ink); }
.cb-body span { font-size: 13px; color: var(--ink-3); }
.cb-go { width: 18px; height: 18px; stroke: var(--accent); flex: none; }

/* ---- calendar ---- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 18px; flex-wrap: wrap; gap: 12px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-nav button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cal-nav button:hover { border-color: var(--accent); }
.cal-nav button svg { width: 18px; height: 18px; stroke: var(--ink-2); fill: none; stroke-width: 2; }
.cal-month { font-family: var(--serif); font-weight: 400; font-size: 26px; min-width: 220px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); text-align: center; padding: 6px 0; }
.cal-cell { min-height: 96px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--paper); display: flex; flex-direction: column; gap: 4px; }
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-date { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cal-cell.today .cal-date { color: var(--accent); }
.cal-ev { font-size: 11.5px; font-weight: 600; color: #fff; border-radius: 5px; padding: 3px 7px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.meeting { background: var(--accent); }
.cal-ev.opening { background: #1f9d57; }
.cal-ev.conference { background: #8a5cf6; }
.cal-ev.milestone { background: #d98324; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 22px 0; }
.cal-legend span { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }
.cal-legend i { width: 12px; height: 12px; border-radius: 4px; }
.up-list { display: flex; flex-direction: column; gap: 10px; }
.up-item { display: flex; gap: 16px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; }
.up-date { text-align: center; flex: none; width: 58px; }
.up-date .um { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.up-date .ud { font-family: var(--serif); font-size: 30px; line-height: 1; }
.up-body { flex: 1; min-width: 0; }
.up-body .ut { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 100px; color: #fff; margin-bottom: 5px; }
.up-body b { display: block; font-size: 16px; font-weight: 600; }
.up-body p { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.up-body a.up-link { font-size: 13px; font-weight: 600; color: var(--accent); }
.up-actions { display: flex; gap: 6px; flex: none; }

@media (max-width: 860px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-card { position: static; }
  .cal-cell { min-height: 64px; }
  .cal-ev { font-size: 0; padding: 4px; }
  .cal-ev::before { content: ''; display: block; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
}

/* ---- knowledge base filters ---- */
.kb-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.kb-chip { font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); border-radius: 100px; padding: 8px 16px; cursor: pointer; transition: .15s; }
.kb-chip:hover { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
.kb-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
/* ---- knowledge base folders ---- */
.kb-folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
.kb-folder { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; cursor: pointer; text-align: left; transition: border-color .15s, transform .15s, box-shadow .15s; }
.kb-folder:hover { border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); transform: translateY(-2px); box-shadow: 0 10px 30px -18px rgba(0,0,0,.28); }
.kb-folder .kf-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in oklab, var(--accent) 12%, var(--paper)); }
.kb-folder .kf-ico svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; stroke-width: 1.7; }
.kb-folder h3 { font-family: var(--sans); font-size: 16.5px; font-weight: 700; color: var(--ink); margin: 0; }
.kb-folder .kf-count { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.kb-crumb { display: flex; align-items: center; gap: 10px; margin: 2px 0 18px; font-size: 14px; }
.kb-crumb button { background: none; border: none; color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; padding: 0; font-family: var(--sans); }
.kb-crumb button:hover { text-decoration: underline; }
.kb-crumb .kc-sep { color: var(--ink-3); }
.kb-crumb .kc-here { color: var(--ink-2); font-weight: 600; }
.support-quick { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.support-quick a { font-size: 14.5px; font-weight: 600; color: var(--accent); }

/* ---- branded media banner ---- */
.portal-banner { position: relative; border-radius: 20px; overflow: hidden; margin: 8px 0 14px; min-height: 280px; display: flex; align-items: flex-end; background: var(--ink); }
.portal-banner video, .portal-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portal-banner .pb-scrim { position: absolute; inset: 0; background: linear-gradient(105deg, rgba(13,19,23,.92) 0%, rgba(13,19,23,.72) 38%, rgba(13,19,23,.30) 70%, rgba(0,128,178,.28) 100%); }
.portal-banner .pb-inner { position: relative; padding: 40px 44px; max-width: 640px; }
.portal-banner .pb-eyebrow { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-soft); font-weight: 600; }
.portal-banner h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px,4vw,48px); line-height: 1.04; letter-spacing: -.01em; color: #fff; margin: 12px 0 10px; }
.portal-banner p { font-size: 16.5px; line-height: 1.55; color: #c5ccd2; max-width: 42em; }
.portal-banner .pb-stats { display: flex; gap: 28px; margin-top: 20px; }
.portal-banner .pb-stats .s b { font-family: var(--serif); font-size: 30px; color: #fff; line-height: 1; }
.portal-banner .pb-stats .s span { display: block; font-size: 12px; color: #aab3bb; margin-top: 5px; letter-spacing: .02em; }
.portal-banner .pb-mark { position: absolute; top: 26px; right: 30px; height: 22px; opacity: .9; }

/* course-card media header */
.course-card .cc-media { position: relative; height: 132px; overflow: hidden; background: var(--ink); }
.course-card .cc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.course-card:hover .cc-media img { transform: scale(1.04); }
.course-card .cc-media .cc-grad { position: absolute; inset: 0; }
.course-card .cc-media.cert .cc-grad { background: linear-gradient(135deg, rgba(13,19,23,.55), rgba(0,128,178,.45)); }
.course-card .cc-media .cc-badges { position: absolute; left: 16px; right: 16px; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.course-card .cc-media .cc-cat { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #fff; font-weight: 700; background: rgba(0,0,0,.32); backdrop-filter: blur(4px); padding: 5px 10px; border-radius: 100px; }
.course-card .cc-media .cc-cert { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--ink); background: var(--accent-soft); padding: 5px 9px; border-radius: 100px; }

@media (max-width: 1000px) {
  .portal-banner .pb-inner { padding: 30px 28px; }
  .course-grid { grid-template-columns: 1fr 1fr; }
  .player { grid-template-columns: 1fr; gap: 20px; }
  .player-side { position: static; }
  .mod-list { gap: 6px; }
}
@media (max-width: 620px) {
  .gate-row, .role-grid, .adm-2col { grid-template-columns: 1fr; }
  .course-grid { grid-template-columns: 1fr; }
  .adm-table thead { display: none; }
  .adm-table td { display: block; border: none; padding: 4px 0; }
  .adm-table tr { display: block; border-bottom: 1px solid var(--line); padding: 14px 0; }
}
