/* SIE Learn — additions on top of style.css (which matches Internal Tools). */

.topbar nav a.on { color:var(--fg); font-weight:600; }
.count-pill { display:inline-block; min-width:1.3em; padding:0 .4em; border-radius:999px; background:var(--brand);
              color:#fff; font-size:.72rem; font-weight:700; text-align:center; line-height:1.45; }
.foot .app-version { margin-right:.25rem; }

/* ---------- Progress ---------- */
.progress { height:8px; background:var(--soft); border:1px solid var(--line); border-radius:999px; overflow:hidden; }
.progress > span { display:block; height:100%; background:var(--ok); border-radius:999px; }
.progress-row { display:flex; align-items:center; gap:.75rem; font-size:.85rem; color:var(--muted); }
.progress-row .progress { flex:1; }

/* ---------- Course cards (dashboard) ---------- */
.course-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:1rem; margin-bottom:2rem; }
.course-card { display:flex; flex-direction:column; gap:.6rem; text-decoration:none; color:var(--fg);
               border:1px solid var(--line); border-radius:var(--radius); padding:1.25rem; background:#fff;
               transition:border-color .15s, box-shadow .15s; }
a.course-card:hover { border-color:var(--brand); box-shadow:0 4px 14px rgba(176,17,22,.08); }
.course-card .division { font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:600; }
.course-card .title { font-weight:700; font-size:1.05rem; line-height:1.3; }
.course-card .meta { font-size:.82rem; color:var(--muted); }
.course-card form { margin:0; }
.course-card button { margin-top:.25rem; }
.section-h { font-size:.78rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:2rem 0 .75rem; }
.search-inline { display:flex; gap:.5rem; margin:0 0 1.75rem; }
.search-inline input { flex:1; }
.search-inline button { width:auto; margin:0; padding:.6rem 1.2rem; }

/* ---------- Course page / checksheet ---------- */
.course-head { display:flex; justify-content:space-between; gap:1.5rem; align-items:flex-start; flex-wrap:wrap; margin-bottom:1.5rem; }
.course-head .division { font-size:.75rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:600; }
.course-head h1 { margin:.15rem 0 .5rem; }
.course-head .actions { display:flex; gap:.5rem; flex-wrap:wrap; }
.course-stats { display:flex; gap:1.5rem; flex-wrap:wrap; font-size:.85rem; color:var(--muted); margin:.75rem 0 0; }
.course-stats strong { color:var(--fg); }

.checksheet { list-style:none; margin:0; padding:0; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
.checksheet li { border-bottom:1px solid var(--line); }
.checksheet li:last-child { border-bottom:none; }
.checksheet .sec { background:var(--soft); padding:.6rem 1rem; font-weight:700; font-size:.85rem; text-transform:uppercase; letter-spacing:.04em; }
.checksheet a.item { display:grid; grid-template-columns:2.2rem 1.6rem 1fr auto; gap:.6rem; align-items:center;
                     padding:.65rem 1rem; text-decoration:none; color:var(--fg); }
.checksheet a.item:hover { background:#fafafa; }
.checksheet .num { color:var(--muted); font-size:.82rem; text-align:right; font-variant-numeric:tabular-nums; }
.checksheet .lbl { min-width:0; }
.checksheet .kind { font-size:.7rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:600; margin-right:.4rem; }
.checksheet .is-next { background:var(--brand-soft); }

/* status dot */
.dot { width:1.25rem; height:1.25rem; border-radius:50%; border:2px solid var(--line-strong); display:inline-flex;
       align-items:center; justify-content:center; font-size:.7rem; font-weight:700; color:#fff; }
.dot.done { background:var(--ok); border-color:var(--ok); }
.dot.done::after { content:"✓"; }
.dot.submitted { border-color:var(--warn); background:var(--warn-soft); }
.dot.submitted::after { content:""; width:.45rem; height:.45rem; border-radius:50%; background:var(--warn); }
.dot.returned { background:var(--err); border-color:var(--err); }
.dot.returned::after { content:"!"; }

/* ---------- Step page ---------- */
.step-nav { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin:0 0 1.25rem; font-size:.85rem; }
.step-nav a { text-decoration:none; }
.step-nav .pos { color:var(--muted); }
.step-head { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; margin-bottom:.5rem; }
.kind-tag { font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; font-weight:700; color:var(--brand); }
.step-title { margin:0 0 .75rem; }
.prompt { color:var(--muted); margin:0 0 1.25rem; }
.instructions { background:var(--soft); border:1px solid var(--line); border-radius:8px; padding:1rem 1.15rem; margin:0 0 1.25rem; }
.instructions p:first-child { margin-top:0; }
.instructions p:last-child { margin-bottom:0; }
.submit-card { margin-top:1.5rem; }
.submit-card h2 { margin-bottom:.5rem; }
.submit-card button { width:auto; padding:.7rem 1.4rem; }
.submit-card .alert { margin-bottom:1rem; }
.answer { background:#fff; border:1px solid var(--line); border-left:3px solid var(--line-strong); border-radius:8px;
          padding:.85rem 1rem; margin:.5rem 0; white-space:normal; }
.sub-meta { font-size:.9rem; margin:.5rem 0; }
.thumbs { display:flex; gap:.6rem; flex-wrap:wrap; margin:.6rem 0; }
.thumbs img { width:140px; height:140px; object-fit:cover; border:1px solid var(--line); border-radius:8px; display:block; }
.file-link { display:inline-block; padding:.5rem .8rem; border:1px solid var(--line); border-radius:8px; font-size:.85rem; }
.step-footer { display:flex; justify-content:space-between; gap:1rem; margin-top:2rem; padding-top:1rem; border-top:1px solid var(--line); }
.step-footer a { text-decoration:none; font-weight:600; max-width:48%; }
.step-footer .next { text-align:right; margin-left:auto; }
.step-footer small { display:block; font-weight:400; color:var(--muted); }

/* review conversation */
.timeline { list-style:none; margin:.75rem 0 0; padding:0; font-size:.88rem; }
.timeline li { border-left:2px solid var(--line); padding:.15rem 0 .75rem .9rem; position:relative; }
.timeline li::before { content:""; position:absolute; left:-6px; top:.4rem; width:10px; height:10px; border-radius:50%; background:var(--line-strong); }
.timeline li.tl-approved::before { background:var(--ok); }
.timeline li.tl-returned::before { background:var(--err); }
.timeline li.tl-submitted::before { background:var(--warn); }
.tl-body { margin-top:.3rem; background:var(--soft); border-radius:8px; padding:.6rem .8rem; }
.tl-returned .tl-body { background:var(--err-soft); }

/* ---------- Review ---------- */
.review-actions { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; margin-top:.75rem; }
.review-actions button { margin:0; }
.btn-approve { background:var(--ok); border-color:var(--ok); }
.btn-approve:hover { background:#116a32; }
.btn-return { background:#fff; color:var(--err); border-color:#f3c4c4; }
.btn-return:hover { background:var(--err-soft); }
.review-item { border:1px solid var(--line); border-radius:var(--radius); padding:1rem 1.25rem; margin-bottom:.75rem; background:#fff; }
.review-item h3 { margin:0 0 .25rem; font-size:1rem; }
.review-item .meta { font-size:.82rem; color:var(--muted); }
.inline-review { display:flex; gap:.5rem; flex-wrap:wrap; align-items:flex-start; margin-top:.6rem; }
.inline-review form { margin:0; display:flex; gap:.5rem; flex:1; min-width:260px; }
.inline-review input { flex:1; padding:.4rem .6rem; font-size:.85rem; }
.inline-review .btn-mini { white-space:nowrap; }

/* ---------- Search ---------- */
.results { list-style:none; margin:0; padding:0; }
.results li { padding:1rem 0; border-bottom:1px solid var(--line); }
.results li:last-child { border-bottom:none; }
.results a.r-title { font-weight:700; font-size:1.02rem; text-decoration:none; }
.results a.r-title:hover { text-decoration:underline; }
.results .snippet { margin:.3rem 0; color:var(--fg); font-size:.9rem; }
.results .in { font-size:.8rem; color:var(--muted); }
mark { background:#fff1a8; color:inherit; border-radius:2px; padding:0 .05em; }

/* ---------- Full hat pack ---------- */
.pack-layout { display:grid; grid-template-columns:260px 1fr; gap:2.5rem; align-items:start; }
.pack-toc { position:sticky; top:1rem; max-height:calc(100vh - 2rem); overflow:auto; font-size:.84rem;
            border-right:1px solid var(--line); padding-right:1rem; }
.pack-toc ol { margin:0; padding-left:1.6rem; }
.pack-toc li { margin:.3rem 0; }
.pack-toc li::marker { color:var(--muted); }
.pack-toc a { text-decoration:none; color:var(--fg); }
.pack-toc a:hover { color:var(--brand); }
.pack-toc a.active { font-weight:700; color:var(--brand); }
.pack-toc li:has(> a.active)::marker { color:var(--brand); font-weight:700; }
.pack-filter { width:100%; margin-bottom:.75rem; padding:.5rem .7rem; font-size:.88rem; }
.pack-doc + .pack-doc { margin-top:3rem; padding-top:2rem; border-top:3px double var(--line-strong); }
.pack-num { font-size:.75rem; color:var(--muted); font-weight:600; }
@media (max-width:860px) {
    .pack-layout { grid-template-columns:1fr; }
    .pack-toc { position:static; max-height:none; border-right:none; padding-right:0; }
}
@media print {
    .pack-toc, .step-nav, .step-footer, .submit-card { display:none !important; }
    .pack-layout { display:block; }
    .pack-doc { break-before:page; }
}

/* ---------- Policy document (the content itself) ---------- */
.policy-doc { font-size:1rem; line-height:1.65; }
.policy-doc > header { text-align:center; margin:0 0 1.75rem; padding-bottom:1.1rem; border-bottom:1px solid var(--line); }
.policy-doc .distribution { list-style:none; margin:0 0 .9rem; padding:0; text-align:left; font-size:.82rem; color:var(--muted); }
.policy-doc .kind { margin:0; font-weight:700; letter-spacing:.08em; text-transform:uppercase; font-size:.85rem; }
.policy-doc .date, .policy-doc .revised { margin:.1rem 0; color:var(--muted); font-size:.88rem; }
.policy-doc .revised { font-style:italic; }
.policy-doc .policy-title { font-size:1.5rem; line-height:1.25; margin:.6rem 0 0; }
.policy-doc .cancelled { color:var(--err); font-weight:600; margin:.5rem 0 0; }
.policy-body h2 { font-size:1.12rem; margin:1.6rem 0 .5rem; }
.policy-body h3 { font-size:1rem; margin:1.3rem 0 .4rem; }
.policy-body p { margin:.6rem 0; }
.policy-body ul, .policy-body ol { margin:.5rem 0; padding-left:1.75rem; }
.policy-body li { margin:.25rem 0; }
.policy-body li > p { margin:.3rem 0; }
.policy-body li ul { list-style-type:circle; }
/* A list without bullets (Styles → List without bullets): nested levels show only by their indent. */
.policy-body ul.plain, .policy-body ul.plain ul { list-style:none; }
.policy-body ul.plain li { margin:.15rem 0; }
.policy-body ul.plain ul { margin:.15rem 0; }
.policy-body .subtitle { text-align:center; font-weight:600; margin:-.75rem 0 1.25rem; }
.policy-body .center { text-align:center; }
.policy-body .indent-1 { margin-left:1.75rem; }
.policy-body .indent-2 { margin-left:3.5rem; }
.policy-body .indent-3 { margin-left:5.25rem; }
.policy-body figure { margin:1rem 0; }
.policy-body img { max-width:100%; height:auto; border:1px solid var(--line); border-radius:4px; background:#fff; }
.policy-body table { border-collapse:collapse; margin:1rem 0; }
.policy-body th, .policy-body td { border:1px solid var(--line); padding:.4rem .6rem; }
.policy-doc .signature { margin-top:2rem; padding-top:.9rem; border-top:1px solid var(--line); }

/* ---------- Admin / editor ---------- */
.stat-tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:.75rem; margin:0 0 1.5rem; }
.stat-tile { border:1px solid var(--line); border-radius:var(--radius); padding:.9rem 1rem; background:#fff; }
.stat-tile .n { font-size:1.6rem; font-weight:700; line-height:1.1; }
.stat-tile .l { font-size:.78rem; color:var(--muted); }
.admin-links { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:.75rem; margin-bottom:2rem; }
.code-editor { font-family:var(--mono); font-size:.82rem; line-height:1.5; min-height:520px; tab-size:2; white-space:pre; }
.editor-layout { display:grid; grid-template-columns:1fr 1fr; gap:1.25rem; align-items:start; }
.editor-preview { border:1px solid var(--line); border-radius:var(--radius); padding:1.25rem; max-height:80vh; overflow:auto; position:sticky; top:1rem; }
@media (max-width:1000px) { .editor-layout { grid-template-columns:1fr; } .editor-preview { position:static; } }
.wrap.full { max-width:1400px; }
.steps-table td.ord { white-space:nowrap; width:1%; }
.steps-table .sec-row td { background:var(--soft); font-weight:700; }
.steps-table form { display:inline; margin:0; }
.icon-btn { all:unset; cursor:pointer; padding:0 .3rem; color:var(--muted); font-size:.95rem; }
.icon-btn:hover { color:var(--fg); }
.hint { font-size:.8rem; color:var(--muted); margin:.35rem 0 0; }
.text-ok { color:var(--ok); } .text-warn { color:var(--warn); } .text-err { color:var(--err); }
.diff del { background:#fde2e2; text-decoration:line-through; }
.diff ins { background:#dcfce7; text-decoration:none; }

/* ---------- Small utilities ---------- */
.mt { margin-top:.75rem; }
.row-actions button { width:auto; margin:0; padding:.7rem 1.3rem; }
.btn-secondary { background:#fff; color:var(--fg); border-color:var(--line-strong); }
.btn-secondary:hover { background:var(--soft); }
.inline-row { display:flex; gap:.4rem; align-items:center; flex-wrap:wrap; margin:0; }
.inline-row select { width:auto; padding:.35rem .5rem; font-size:.82rem; }
details.more > summary { cursor:pointer; font-weight:600; }
details.more[open] > summary { margin-bottom:1rem; }
[hidden] { display:none !important; }

/* ---------- Rich-text editor (TinyMCE) ---------- */
/* Inside the editor's frame: look like the published policy, but as a plain page. */
body.editor-body { display:block; min-height:0; max-width:50rem; margin:0 auto; padding:1rem 1.25rem; background:#fff; }
.tox-tinymce { border-color:var(--line-strong) !important; border-radius:8px !important; }

.inline-row.roles { gap:1rem; }
.inline-row.roles .check { margin:0; }
.edit-links { margin-left:auto; display:flex; justify-content:flex-end; gap:.4rem; }
.edit-links.mb { margin-bottom:.6rem; }
