/* ===== RESET & VARIABLES ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:        #0a3d2e;
  --primary-mid:    #0f5c44;
  --primary-light:  #14916a;
  --accent:         #c8922a;
  --accent-light:   #f5c86a;
  --success:        #16a34a;
  --danger:         #dc2626;
  --warning:        #d97706;
  --bg:             #f0f7f3;
  --card:           #ffffff;
  --sidebar-bg:     #051a14;
  --sidebar-w:      290px;
  --progress-h:     58px;
  --header-h:       66px;
  --radius:         14px;
  --shadow:         0 2px 16px rgba(0,0,0,0.08);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.14);
  --text:           #16241f;
  --muted:          #4f7568;
  --border:         #d8e8e0;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== LAYOUT ===== */
#app { display: flex; flex-direction: column; min-height: 100vh; }

.wrap {
  display: flex;
  flex: 1;
  padding-top: var(--header-h);
  padding-bottom: var(--progress-h);
}

/* ===== HEADER ===== */
.hdr {
  position: fixed; inset: 0 0 auto 0;
  height: var(--header-h);
  background: var(--primary);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  z-index: 300;
  box-shadow: 0 2px 16px rgba(0,0,0,0.35);
}

.hdr-logo { display: flex; align-items: center; gap: 14px; }

.hdr-badge {
  background: var(--accent);
  color: #fff;
  font-size: 12px; font-weight: 800;
  padding: 5px 11px; border-radius: 7px;
  letter-spacing: 0.6px; text-transform: uppercase;
}

.hdr-title { color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 0.2px; }
.hdr-sub { color: rgba(255,255,255,0.55); font-size: 12px; font-weight: 400; margin-top: 1px; }

.hdr-user {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 24px;
  padding: 7px 16px;
  color: #fff; font-size: 13px; font-weight: 500;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: var(--header-h); bottom: var(--progress-h); left: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  overflow-y: auto;
  z-index: 200;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.sb-inner { padding: 18px 0 36px; }

/* Sidebar overview link */
.sb-overview {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 22px;
  color: rgba(255,255,255,0.65);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.18s;
}
.sb-overview:hover, .sb-overview.active {
  color: #fff; background: rgba(255,255,255,0.06);
  border-left-color: var(--accent);
}

/* Module heading in sidebar */
.sb-mod-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px 8px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.1px;
  color: rgba(255,255,255,0.32);
  margin-top: 4px;
}

.sb-dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
}
.sb-dot.locked   { background: rgba(255,255,255,0.15); }
.sb-dot.active   { background: var(--accent); }
.sb-dot.done     { background: var(--success); }

/* Sidebar lesson link */
.sb-lesson {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 22px 9px 30px;
  color: rgba(255,255,255,0.48);
  font-size: 13px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.18s;
}
.sb-lesson:hover:not(.sb-locked) {
  color: rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.05);
}
.sb-lesson.sb-active  { color: #fff; background: rgba(20,145,106,0.35); border-left-color: var(--accent); font-weight: 600; }
.sb-lesson.sb-done    { color: rgba(255,255,255,0.6); }
.sb-lesson.sb-locked  { color: rgba(255,255,255,0.22); cursor: not-allowed; }

.sb-icon { font-size: 12px; flex-shrink: 0; width: 16px; text-align: center; }

/* Sidebar quiz/cert links */
.sb-action {
  display: flex; align-items: center; gap: 10px;
  margin: 6px 14px 0;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  cursor: not-allowed;
  color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.04);
  transition: all 0.18s;
}
.sb-action.unlocked {
  cursor: pointer;
  color: var(--accent);
  background: rgba(200,146,42,0.12);
}
.sb-action.unlocked:hover { background: rgba(200,146,42,0.22); }

/* ===== MAIN CONTENT ===== */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 44px 52px;
  min-height: calc(100vh - var(--header-h) - var(--progress-h));
}

/* ===== PAGE SYSTEM ===== */
.page { display: none; }
.page.active { display: block; animation: rise 0.28s ease; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== WELCOME / OVERVIEW ===== */
.hero {
  background: linear-gradient(130deg, var(--primary) 0%, #0f5c44 55%, #17a673 100%);
  border-radius: 20px;
  padding: 54px 50px;
  color: #fff;
  position: relative; overflow: hidden;
  margin-bottom: 40px;
}
.hero::before {
  content: "";
  position: absolute; top: -80px; right: -80px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.hero::after {
  content: "";
  position: absolute; bottom: -50px; right: 60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}

.hero-eyebrow {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px; font-weight: 800;
  padding: 4px 12px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 1.2px;
  margin-bottom: 16px;
}

.hero h2 { font-size: 30px; font-weight: 800; line-height: 1.25; margin-bottom: 14px; }
.hero p  { font-size: 15px; opacity: 0.82; max-width: 560px; line-height: 1.7; }

.hero-chips {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 28px;
}
.chip {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.11);
  border: 1px solid rgba(255,255,255,0.17);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12.5px; font-weight: 500;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
  margin-bottom: 36px;
}

.mod-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative; overflow: hidden;
}
.mod-card:hover:not(.mod-locked) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.mod-card.mod-locked   { opacity: 0.55; cursor: not-allowed; }
.mod-card.mod-done     { border-color: var(--success); }

.mod-icon {
  width: 46px; height: 46px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}
.mod-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.mod-card p  { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

.mod-tag {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: 8px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.tag-locked { background: #e8edf4; color: #8fa3bd; }
.tag-active { background: #d3f0e3; color: var(--primary-light); }
.tag-done   { background: #dcfce7; color: var(--success); }

/* ===== LESSON LAYOUT ===== */
.lesson-hdr { margin-bottom: 30px; }

.breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--muted);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--primary-light); text-decoration: none; cursor: pointer; }
.breadcrumb a:hover { text-decoration: underline; }

.lesson-tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 8px;
  background: #d3f0e3; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.lesson-title { font-size: 26px; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.lesson-sub   { font-size: 14px; color: var(--muted); }

.ld { /* lesson divider */
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), transparent);
  border-radius: 2px;
  margin: 22px 0;
}

.lesson-body {
  background: var(--card);
  border-radius: var(--radius);
  padding: 38px 42px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  font-size: 15px; line-height: 1.85;
}

.lesson-body h3 {
  font-size: 16.5px; font-weight: 700;
  color: var(--primary);
  margin: 26px 0 12px;
}
.lesson-body h3:first-child { margin-top: 0; }

.lesson-body p   { margin-bottom: 14px; }
.lesson-body strong { color: var(--primary); }

.lesson-body ul,
.lesson-body ol  { padding-left: 22px; margin-bottom: 16px; }
.lesson-body li  { margin-bottom: 9px; }

/* Content components */
.callout {
  border-left: 4px solid var(--primary-light);
  background: linear-gradient(135deg, #e9f7f1, #d3f0e3);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
}
.callout.warn {
  border-left-color: var(--warning);
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}
.callout.success {
  border-left-color: var(--success);
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}
.callout.danger {
  border-left-color: var(--danger);
  background: linear-gradient(135deg, #fff5f5, #fee2e2);
}

.law-box {
  background: linear-gradient(135deg, #0a3d2e, #0f5c44);
  border-radius: 12px;
  padding: 22px 26px;
  margin: 20px 0;
  color: rgba(255,255,255,0.92);
  font-size: 14px; line-height: 1.75;
}
.law-box .law-label {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent-light);
  margin-bottom: 8px;
}
.law-box strong { color: var(--accent-light); }

.scenario {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 20px 0;
}
.scenario .s-label {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); margin-bottom: 8px;
}

.case-study {
  background: linear-gradient(135deg, #142a22, #0a3d2e);
  border-radius: 12px;
  padding: 22px 26px;
  margin: 20px 0;
  color: rgba(255,255,255,0.88);
  font-size: 14px; line-height: 1.75;
  border-left: 4px solid var(--accent);
}
.case-study .cs-label {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent-light); margin-bottom: 8px;
}

.steps-list { list-style: none; padding: 0; margin: 16px 0; }
.steps-list li {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.steps-list li:last-child { border-bottom: none; }
.step-num {
  min-width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
}

/* Tables inside lesson content */
.lesson-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 22px;
  font-size: 13.5px;
}
.lesson-body table th {
  background: var(--primary);
  color: #fff;
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.lesson-body table th:first-child { border-radius: 8px 0 0 0; }
.lesson-body table th:last-child  { border-radius: 0 8px 0 0; }
.lesson-body table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.lesson-body table tr:nth-child(even) td { background: rgba(0,0,0,0.02); }

/* ===== LESSON NAV ===== */
.lesson-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  border: none; cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}
.btn-ghost  { background: #edf2f8; color: var(--text); }
.btn-ghost:hover  { background: #dde5f0; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-mid); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-accent  { background: var(--accent); color: #fff; }
.btn-accent:hover  { background: #a87320; }

/* ===== QUIZ ===== */
.quiz-hero {
  background: linear-gradient(130deg, #0a3d2e, #17a673);
  border-radius: 18px;
  padding: 38px 44px;
  color: #fff; margin-bottom: 38px;
}
.quiz-hero h2 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.quiz-hero p  { font-size: 14.5px; opacity: 0.82; }

.quiz-chips { display: flex; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.qchip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.12);
  padding: 6px 14px; border-radius: 20px;
  font-size: 12.5px; font-weight: 500;
}

.q-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 36px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.q-num {
  font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.1px;
  color: var(--primary-light); margin-bottom: 12px;
}

.q-text {
  font-size: 16px; font-weight: 600;
  line-height: 1.6; color: var(--text);
  margin-bottom: 22px;
}

.q-opts { display: flex; flex-direction: column; gap: 10px; }

.opt {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 13px 18px;
  border-radius: 10px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.18s;
  background: var(--card);
  font-size: 14px; line-height: 1.5;
  user-select: none;
}
.opt:hover   { border-color: var(--primary-light); background: #f0f7ff; }
.opt.sel     { border-color: var(--primary); background: #e9f7f1; }
.opt.correct { border-color: var(--success); background: #f0fdf4; }
.opt.wrong   { border-color: var(--danger);  background: #fef2f2; }

.opt-key {
  min-width: 28px; height: 28px;
  border-radius: 50%;
  background: #e8edf4;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--muted);
  flex-shrink: 0;
}
.opt.sel .opt-key     { background: var(--primary);       color: #fff; }
.opt.correct .opt-key { background: var(--success);       color: #fff; }
.opt.wrong   .opt-key { background: var(--danger);        color: #fff; }

.q-rationale {
  display: none;
  margin-top: 16px;
  background: #f0f7ff;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 13.5px; line-height: 1.65; color: var(--text);
  border-left: 3px solid var(--primary-light);
}
.q-rationale.show { display: block; }

.quiz-submit-row { display: flex; justify-content: center; padding: 10px 0 40px; }

.submit-btn {
  background: var(--primary); color: #fff;
  font-size: 16px; font-weight: 700;
  padding: 16px 50px; border-radius: 12px;
  border: none; cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(10,61,46,0.3);
  font-family: inherit;
}
.submit-btn:hover   { background: var(--primary-mid); transform: translateY(-1px); }
.submit-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ===== RESULTS ===== */
.result-wrap {
  background: var(--card);
  border-radius: 20px;
  padding: 50px 44px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  margin-bottom: 36px;
}

.score-ring {
  width: 140px; height: 140px;
  border-radius: 50%;
  margin: 0 auto 22px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 38px; font-weight: 800;
  border: 8px solid;
}
.score-ring.pass { border-color: var(--success); color: var(--success); }
.score-ring.fail { border-color: var(--danger);  color: var(--danger);  }
.score-ring small { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; }

.result-title { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.result-sub   { font-size: 14.5px; color: var(--muted); max-width: 480px; margin: 0 auto 28px; line-height: 1.7; }

.result-btns  { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ===== CERTIFICATE ===== */
/* ── Outer navy card ── */
.cert-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    overflow-x: auto;
}

.certificate {
    border-radius: 4px;
    max-width: none;
    width: fit-content;
    padding: 0;
    position: relative;
    overflow: visible;
}

    /* A4 landscape (297×210 mm at 96 dpi ≈ 1122×794 px) */
    .cert-outer {
        background: linear-gradient(130deg, var(--primary) 0%, #0f5c44 55%, #17a673 100%);
        border-radius: 6px;
        padding: 18px;
        position: relative;
        box-shadow: 0 24px 64px rgba(0, 0, 0, 0.32);
        width: 1010px;
        height: auto;
        box-sizing: border-box;
    }

    /* corner gold pins */
    .cert-outer::before,
    .cert-outer::after,
    .cert-outer .c-bl,
    .cert-outer .c-br {
        content: "";
        position: absolute;
        width: 11px;
        height: 11px;
        border-radius: 50%;
        background: #c9a84c;
        z-index: 2;
    }

    .cert-outer::before {
        top: 13px;
        left: 13px;
    }

    .cert-outer::after {
        top: 13px;
        right: 13px;
    }

    .cert-outer .c-bl {
        bottom: 13px;
        left: 13px;
    }

    .cert-outer .c-br {
        bottom: 13px;
        right: 13px;
    }

    /* ── Gold frame ── */
    .cert-frame {
        border: 2px solid #c9a84c;
        border-radius: 3px;
        position: relative;
        height: calc(100% - 36px);
        display: flex;
        flex-direction: column;
    }

    .cert-frame::before,
    .cert-frame::after,
    .cert-frame .f-bl,
    .cert-frame .f-br {
        content: "";
        position: absolute;
        width: 34px;
        height: 34px;
        border-color: #c9a84c;
        border-style: solid;
        z-index: 1;
    }

    .cert-frame::before {
        top: -2px;
        left: -2px;
        border-width: 3px 0 0 3px;
        border-radius: 2px 0 0 0;
    }

    .cert-frame::after {
        top: -2px;
        right: -2px;
        border-width: 3px 3px 0 0;
        border-radius: 0 2px 0 0;
    }

    .cert-frame .f-bl {
        bottom: -2px;
        left: -2px;
        border-width: 0 0 3px 3px;
        border-radius: 0 0 0 2px;
    }

    .cert-frame .f-br {
        bottom: -2px;
        right: -2px;
        border-width: 0 3px 3px 0;
        border-radius: 0 0 2px 0;
    }

    /* ── White inner body ── */
    .cert-inner {
        background: #fff;
        padding: 42px 64px 34px;
        text-align: center;
        position: relative;
        overflow: hidden;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    /* ── Watermark ── */
    .watermark {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 460px;
        height: 460px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        opacity: 0.10;
        pointer-events: none;
        z-index: 0;
    }

    .cert-inner>*:not(.watermark) {
        position: relative;
        z-index: 1;
    }

    /* ── Header: logo + org name ── */
    .org-header {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 14px;
/*        margin-bottom: 18px;*/
        padding-bottom: 16px;
        /*      border-bottom: 1px solid #e8e3d8;*/
    }

    .org-logo {
        width: 72px;
        height: 72px;
        object-fit: contain;
        flex-shrink: 0;
    }

    .org-text {
        text-align: left;
    }

    .org-name-main {
        font-family: "Lato", sans-serif;
        font-size: 15px;
        font-weight: 700;
        color: #7f6c2a;
        letter-spacing: 0.04em;
        line-height: 1.3;
    }

    .org-name-abbr {
        font-family: "Lato", sans-serif;
        font-size: 11px;
        font-weight: 400;
        color: #7a6000;
        letter-spacing: 0.06em;
        margin-top: 1px;
    }

    .org-tagline {
        font-family: "Lato", sans-serif;
        font-size: 10px;
        font-weight: 400;
        color: #e05a10;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        margin-top: 3px;
    }

    /* ── Certificate title ── */
    .cert-title {
        font-family: "Playfair Display", serif;
        font-size: 13px;
        font-weight: 600;
        color: #127c58;
        line-height: 1.2;
        margin-bottom: 10px;
    }

    /* ── "THIS IS TO CERTIFY THAT" ── */
    .cert-eyebrow {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.2em;
        color: #c9a84c;
/*        text-transform: uppercase;*/
        margin-bottom: 16px;
    }

    /* ── Recipient ── */
    .recipient {
        font-family: "Dancing Script", cursive;
        font-size: 36px;
        color: #127c58;
        line-height: 1.1;
        margin-bottom: 12px;
    }

    /* ── Divider ── */
    .divider {
        width: 340px;
        height: 1px;
        background: linear-gradient(90deg, transparent, #c9a84c 20%, #c9a84c 80%, transparent);
        margin: 0 auto 16px;
    }

    /* ── Body text ── */
    .cert-body {
        font-size: 13px;
        font-weight: 500;
        color: #333;
        line-height: 1.8;
        max-width: 630px;
        margin: 0 auto 20px;
    }


    /* ── Body text ── */
    .cert-accent {
        font-size: 10px;
        font-weight: 300;
        color: #333;
        line-height: 1.3;
        max-width: 530px;
        margin: 0 auto 14px;
    }

    /* ── Signatures ── */
    .signatures {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 20px;
        margin-bottom: 26px;
    }

    .sig-block {
        flex: 1;
        text-align: center;
    }

    .sig-art {
        height: 48px;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        margin-bottom: 5px;
    }

    .sig-rule {
        width: 130px;
        height: 1px;
        background: #1b2a6b;
        margin: 0 auto 5px;
    }

    .sig-name {
        font-size: 11px;
        font-weight: 700;
        color: #127c58;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .sig-role {
        font-size: 11px;
        font-weight: 300;
        color: #666;
        margin-top: 2px;
    }

    /* ── Stamp ── */
    .stamp-wrap {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-bottom: 6px;
    }

    /* ── Orange YAC banner accent (echoes logo) ── */
    .yac-accent {
        display: inline-block;
        background: #e05a10;
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.18em;
        text-transform: uppercase;
        padding: 3px 12px;
        border-radius: 2px;
        margin-bottom: 8px;
    }

    /* ── Footer meta ── */
    .cert-meta {
        border-top: 1px solid #ececec;
        padding-top: 13px;
        display: flex;
        justify-content: center;
        gap: 44px;
    }

    .meta-pair {
        font-size: 12px;
        color: #333;
    }

    .meta-label {
        font-weight: 700;
        margin-right: 5px;
    }

    /* ── Buttons ── */
    .actions {
        margin-top: 22px;
        display: flex;
        gap: 12px;
        justify-content: center;
    }

    .btn {
        padding: 10px 28px;
        border-radius: 4px;
        font-family: "Lato", sans-serif;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.06em;
        cursor: pointer;
        border: none;
        transition: opacity .2s;
    }

    .btn:hover {
        opacity: .82;
    }

    .btn-primary {
        background: #1b2a6b;
        color: #fff;
    }

    .btn-orange {
        background: #e05a10;
        color: #fff;
    }

    @media print {
        body {
            background: none;
            padding: 0;
        }

        .actions {
            display: none;
        }

        .cert-outer {
            box-shadow: none;
        }
    }


/*    @media (max-width: 640px) {
        .cert-inner {
            padding: 28px 22px 22px;
        }

        .cert-title {
            font-size: 26px;
        }

        .recipient {
            font-size: 38px;
        }

        .org-logo {
            width: 52px;
            height: 52px;
        }

        .signatures {
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }

        .cert-meta {
            flex-direction: column;
            gap: 8px;
        }
    }*/


/* ===== PROGRESS BAR ===== */
.pgbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--progress-h);
  background: #fff;
  border-top: 1px solid var(--border);
  z-index: 400;
  display: flex; align-items: center;
  padding: 0 28px 0 calc(var(--sidebar-w) + 28px);
  gap: 18px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}

.pg-label { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; min-width: 130px; }
.pg-label span { color: var(--primary-light); }

.pg-track { flex: 1; height: 10px; background: #dde5f0; border-radius: 6px; overflow: hidden; }
.pg-fill  { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 6px; transition: width 0.5s cubic-bezier(.25,.46,.45,.94); }

.pg-pct { font-size: 13px; font-weight: 700; color: var(--primary); min-width: 40px; text-align: right; }

/* ===== MODAL ===== */
.modal-ov {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(5px);
}
.modal-box {
  background: #fff; border-radius: 20px;
  padding: 48px; max-width: 440px; width: 90%;
  text-align: center; box-shadow: var(--shadow-lg);
  animation: rise 0.28s ease;
}
.modal-icon { font-size: 46px; margin-bottom: 16px; }
.modal-box h2 { font-size: 21px; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.modal-box p  { font-size: 14px; color: var(--muted); margin-bottom: 24px; line-height: 1.65; }

.name-input {
  width: 100%; padding: 14px 18px;
  border: 2px solid var(--border); border-radius: 10px;
  font-size: 16px; outline: none;
  transition: border-color 0.2s; font-family: inherit;
}
.name-input:focus { border-color: var(--primary); }

.modal-btn {
  width: 100%; margin-top: 16px;
  background: var(--primary); color: #fff;
  font-size: 15px; font-weight: 700;
  padding: 14px; border-radius: 10px;
  border: none; cursor: pointer;
  transition: background 0.18s; font-family: inherit;
}
.modal-btn:hover { background: var(--primary-mid); }

/* ===== PRINT ===== */
@media print {
  .hdr, .sidebar, .pgbar, .download-btn, .cert-page>*:not(#printable-cert) { display: none !important; }
  .wrap { padding: 0 !important; }
  .content { margin: 0 !important; padding: 0 !important; max-width: 100% !important; }
  body { background: #fff !important; }
  .page { display: none !important; }
  #page-cert { display: block !important; }
  .certificate { box-shadow: none !important; }
}


.cert-display2 {display: none;}

/* ===== RESPONSIVE ===== */

@media (max-width: 820px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-290px); width: 290px; }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; padding: 24px 20px; max-width: 100%; }
  .pgbar { padding-left: 24px; }
  .hero { padding: 32px 26px; }
  .hero h2 { font-size: 22px; }
  .lesson-body { padding: 24px 22px; }
  .cert-inner { padding: 32px 22px; }
  .c-name { font-size: 26px; }
  .cert-display1 {display: none;}
  .cert-display2 {display: block;}
}
