@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&display=swap');

/* ============================================================
   LERNWEG WIDGET — Pixel-perfect reference match v6
   ============================================================ */

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

.lw-wrapper {
    font-family: 'DM Sans', sans-serif;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 24px rgba(0,0,0,.06);
    padding: 28px 28px 32px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Header ── */
.lw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.lw-title {
    font-size: 22px;
    font-weight: 800;
    color: #111;
    letter-spacing: -.3px;
}

.lw-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lw-select {
    appearance: none;
    -webkit-appearance: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    background: #f8f9fb;
    border: 1.5px solid #e4e7ec;
    border-radius: 12px;
    padding: 11px 44px 11px 18px;
    cursor: pointer;
    outline: none;
    min-width: 270px;
    transition: border-color .2s, box-shadow .2s;
}
.lw-select:focus { border-color: #3ebd6e; box-shadow: 0 0 0 3px rgba(62,189,110,.12); }

.lw-chevron {
    position: absolute;
    right: 14px;
    width: 16px;
    height: 16px;
    color: #888;
    pointer-events: none;
    flex-shrink: 0;
}

/* ── Body ── */
.lw-body {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ── LEFT CHART ── */
.lw-chart-wrap { flex: 1.35; min-width: 0; }

.lw-chart-inner {
    position: relative;
    background: linear-gradient(170deg, #f2fbf5 0%, #eaf7f0 60%, #e5f5ee 100%);
    border-radius: 16px;
    padding: 20px 16px 12px 16px;
    overflow: hidden;
    min-height: 300px;
}

#lwCanvas {
    display: block;
    width: 100% !important;
}

/* Markers container — positioned over canvas */
.lw-markers {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

/* Each milestone marker */
.lw-mk {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
    pointer-events: all;
    user-select: none;
    z-index: 10;
}

.lw-mk__label {
    font-size: 10.5px;
    font-weight: 700;
    color: #111;
    line-height: 1;
    margin-bottom: 2px;
    white-space: nowrap;
}

.lw-mk__arrow {
    font-size: 11px;
    color: #111;
    line-height: 1;
    margin-bottom: 2px;
}

.lw-mk__dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid #3ebd6e;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 2px 8px rgba(62,189,110,.18);
    flex-shrink: 0;
}

.lw-mk__dot svg {
    width: 10px; height: 10px;
    stroke: #3ebd6e;
    stroke-width: 3;
    fill: none;
    display: block;
}

/* Completed milestone */
.lw-mk--done .lw-mk__dot {
    background: #3ebd6e;
    border-color: #3ebd6e;
    cursor: pointer;
}
.lw-mk--done .lw-mk__dot svg { stroke: #fff; }
.lw-mk--done:hover .lw-mk__dot {
    transform: scale(1.3);
    box-shadow: 0 4px 18px rgba(62,189,110,.45);
}

/* Locked milestone */
.lw-mk--locked .lw-mk__dot {
    border-color: #c8d0d8;
    background: #fff;
    box-shadow: none;
}
.lw-mk--locked .lw-mk__dot svg { stroke: #c8d0d8; }
.lw-mk--locked .lw-mk__label,
.lw-mk--locked .lw-mk__arrow { color: #b0b8c2; }

/* 100% scissors */
.lw-scissors {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 26px;
    filter: drop-shadow(0 2px 6px rgba(62,189,110,.4));
    animation: lw-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes lw-pulse {
    0%,100% { transform: translateX(-50%) scale(1);    filter: drop-shadow(0 2px 6px rgba(62,189,110,.4)); }
    50%      { transform: translateX(-50%) scale(1.18); filter: drop-shadow(0 4px 12px rgba(62,189,110,.65)); }
}

/* ── RIGHT SIDEBAR ── */
.lw-sidebar {
    flex: 1;
    min-width: 260px;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Section head ── */
.lw-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: #111;
    padding: 14px 16px 10px;
}

.lw-head-icon {
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lw-head-icon svg { width: 10px; height: 10px; }
.lw-head-icon--green         { background: #3ebd6e; }
.lw-head-icon--green svg     { stroke: #fff; }
.lw-head-icon--red           { background: #f04a4a; }
.lw-head-icon--red svg       { stroke: #fff; }

/* Item rows */
.lw-items { padding: 0 12px 12px; }

.lw-item {
    background: #fff;
    border-radius: 10px;
    padding: 9px 12px 9px 10px;
    margin-bottom: 7px;
    border: 1px solid #f0f2f5;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    transition: box-shadow .15s;
}
.lw-item:last-child { margin-bottom: 0; }
.lw-item:hover { box-shadow: 0 3px 10px rgba(0,0,0,.07); }

/* Item row: number + title + right meta */
.lw-item__row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.lw-item__num {
    font-size: 10px;
    font-weight: 700;
    color: #bbb;
    min-width: 14px;
    flex-shrink: 0;
}

.lw-item__title {
    font-size: 12.5px;
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.lw-item__right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Percentage text */
.lw-item__pct {
    font-size: 11.5px;
    font-weight: 700;
    min-width: 32px;
    text-align: right;
}
.lw-item__pct--green  { color: #3ebd6e; }
.lw-item__pct--red    { color: #f04a4a; }
.lw-item__pct--orange { color: #f07800; }
.lw-item__pct--gray   { color: #999; }

/* Time badge — clock icon + text */
.lw-item__time {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    color: #3ebd6e;
    font-weight: 600;
    white-space: nowrap;
}
.lw-item__time svg {
    width: 10px; height: 10px;
    stroke: #3ebd6e;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

/* Progress bar */
.lw-item__bar {
    width: 100%;
    height: 5px;
    background: #f0f2f5;
    border-radius: 99px;
    overflow: hidden;
}
.lw-item__fill {
    height: 100%;
    border-radius: 99px;
    transition: width .7s cubic-bezier(.4,0,.2,1);
    min-width: 3px;
}
.lw-fill--green  { background: linear-gradient(90deg, #5dd47a, #2fa855); }
.lw-fill--red    { background: linear-gradient(90deg, #f87272, #e53535); }
.lw-fill--orange { background: linear-gradient(90deg, #ffb347, #f07800); }
.lw-fill--gray   { background: #d0d5dd; }

/* Weakness item background tint */
.lw-item--weak {
    background: #fff8f8;
    border-color: #fde8e8;
}

/* Empty state */
.lw-empty {
    font-size: 12.5px;
    color: #bbb;
    padding: 8px 4px;
    font-style: italic;
}

/* ── POPUP ── */
.lw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.48);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}
.lw-overlay.open { display: flex; }

.lw-popup {
    background: #fff;
    border-radius: 20px;
    padding: 48px 36px 32px;
    max-width: 390px;
    width: 92%;
    position: relative;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0,0,0,.2);
    animation: lwPopIn .28s cubic-bezier(.34,1.56,.64,1);
}

@keyframes lwPopIn {
    from { transform: scale(.82); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.lw-popup-x {
    position: absolute;
    top: 14px; right: 14px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #3ebd6e;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .15s;
}
.lw-popup-x:hover { background: #2fa855; }
.lw-popup-x svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 2.5; fill: none; }

.lw-popup-scissors { font-size: 54px; margin-bottom: 16px; display: block; }

.lw-popup-heading {
    font-size: 18px; font-weight: 800; color: #111;
    margin: 0 0 2px; line-height: 1.3;
}
.lw-popup-sub {
    font-size: 18px; font-weight: 800; color: #111;
    margin: 0 0 16px;
}
.lw-popup-desc {
    font-size: 13.5px; color: #555;
    line-height: 1.65; margin: 0 0 26px;
}
.lw-popup-btn {
    background: #111; color: #fff;
    border: none; border-radius: 12px;
    padding: 15px 0; width: 100%;
    font-size: 15px; font-weight: 700;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background .2s;
}
.lw-popup-btn:hover { background: #2a2a2a; }

/* ── Responsive ── */
@media (max-width: 800px) {
    .lw-body { flex-direction: column; }
    .lw-sidebar { max-width: 100%; }
    .lw-header { flex-direction: column; align-items: flex-start; }
    .lw-select { min-width: 100%; }
}