.site-main .pt-page {
    background-color: #2C2D2F;
}

.site-main .pt-page .section-container {
    padding-bottom: 60px;
}

/* ── Exercise index grid (lista_01 intro) ── */

.exercise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 32px;
}

.exercise-card {
    display: flex;
    align-items: stretch;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 4px solid #a531cf;
    border-radius: 4px;
    transition: border-color 0.25s, background 0.25s;
    overflow: hidden;
}

.exercise-card:hover {
    background: rgba(255,255,255,0.06);
}

.exercise-card.done {
    border-left-color: #4caf50;
    background: rgba(76,175,80,0.06);
}

.exercise-card-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    text-decoration: none;
    color: #e1e1e1;
    transition: color 0.2s;
}

.exercise-card-link:hover {
    color: #fff;
    text-decoration: none;
}

.exercise-number {
    font-size: 28px;
    font-weight: 700;
    font-family: "Playfair Display", serif;
    color: #a531cf;
    min-width: 36px;
    line-height: 1;
    transition: color 0.25s;
}

.exercise-card.done .exercise-number {
    color: #4caf50;
}

.exercise-title {
    font-size: 14px;
    line-height: 1.4;
    color: #e1e1e1;
}

.exercise-card-done {
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-left: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
}

.exercise-card-done input[type="checkbox"] {
    display: none;
}

.exercise-card-done label {
    cursor: pointer;
    font-size: 22px;
    color: rgba(255,255,255,0.18);
    margin: 0;
    transition: color 0.2s, transform 0.2s;
    display: flex;
}

.exercise-card-done label:hover {
    color: rgba(255,255,255,0.5);
    transform: scale(1.15);
}

.exercise-card.done .exercise-card-done label {
    color: #4caf50;
}

/* ── end exercise grid ── */

/* ── Progressive hints panel ── */

.hints-panel {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px dashed rgba(255,255,255,0.1);
}

.hints-toggle {
    background: none;
    border: 1px solid rgba(165,49,207,0.5);
    color: #a531cf;
    padding: 8px 20px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    font-family: "Roboto", sans-serif;
    letter-spacing: 0.3px;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.exercise-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.hints-toggle:hover {
    background: rgba(165,49,207,0.12);
    border-color: #a531cf;
    color: #c060ef;
}

.hints-toggle.open {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.5);
}

.hints-body {
    display: none;
    margin-top: 20px;
}

.hints-body.open {
    display: block;
}

.hint-item {
    display: none;
    margin-bottom: 14px;
    padding: 16px 20px;
    border-left: 3px solid;
    background: rgba(255,255,255,0.025);
    border-radius: 0 3px 3px 0;
}

.hint-item.visible {
    display: block;
}

.hint-item.level-1 { border-left-color: #f0c040; }
.hint-item.level-2 { border-left-color: #f08040; }
.hint-item.level-3 { border-left-color: #50c878; }

.extra-solution-toggle {
    background: none;
    border: 1px solid rgba(80,200,120,0.45);
    color: #50c878;
    padding: 8px 20px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    font-family: "Roboto", sans-serif;
    letter-spacing: 0.3px;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.extra-solution-toggle:hover {
    background: rgba(80,200,120,0.1);
    border-color: #50c878;
    color: #70e098;
}

.extra-solution-toggle.open {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.5);
}

.solution-extra {
    display: none;
    margin-top: 20px;
    padding: 16px 20px;
    border-left: 3px solid #50c878;
    background: rgba(80,200,120,0.04);
    border-radius: 0 3px 3px 0;
}

.solution-extra.open {
    display: block;
}

.solution-extra .hint-label {
    color: #50c878;
}

.solution-extra p {
    margin-bottom: 10px;
    font-size: 14px;
}

.hint-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 10px;
}

.hint-item.level-1 .hint-label { color: #f0c040; }
.hint-item.level-2 .hint-label { color: #f08040; }
.hint-item.level-3 .hint-label { color: #50c878; }

.hint-item p {
    margin-bottom: 10px;
    font-size: 14px;
}

.hint-item code {
    background: rgba(255,255,255,0.06);
    padding: 1px 5px;
    border-radius: 2px;
    font-size: 13px;
}

pre.hint-code {
    margin-top: 10px;
    padding: 14px 16px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #d4d4d4;
    overflow-x: auto;
    white-space: pre;
}

.hint-next-btn {
    margin-top: 4px;
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.45);
    padding: 7px 16px;
    cursor: pointer;
    font-size: 13px;
    font-family: "Roboto", sans-serif;
    border-radius: 3px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.hint-next-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

.hint-next-btn:disabled {
    display: none;
}

/* ── Solution steps (inside level-3 hint) ── */

.solution-steps {
    margin-top: 14px;
}

.solution-step {
    display: none;
    margin-bottom: 18px;
    padding: 14px 16px;
    background: rgba(80,200,120,0.05);
    border-left: 2px solid rgba(80,200,120,0.3);
    border-radius: 0 3px 3px 0;
    animation: stepFadeIn 0.3s ease;
}

.solution-step.visible {
    display: block;
}

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

.step-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #50c878;
    margin-bottom: 8px;
}

.solution-step p {
    font-size: 14px;
    margin-bottom: 8px;
}

.step-next-btn {
    margin-top: 6px;
    background: none;
    border: 1px solid rgba(80,200,120,0.3);
    color: rgba(80,200,120,0.7);
    padding: 7px 16px;
    cursor: pointer;
    font-size: 13px;
    font-family: "Roboto", sans-serif;
    border-radius: 3px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.step-next-btn:hover {
    background: rgba(80,200,120,0.08);
    color: #50c878;
    border-color: #50c878;
}

.step-next-btn:disabled {
    display: none;
}

/* ── end hints panel ── */

.exercise-nav {
    margin: 30px 0 40px 0;
    padding: 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}

.exercise-nav ul {
    list-style: none !important;
    padding-left: 0;
    margin-bottom: 0;
}

.exercise-nav li {
    margin-bottom: 8px;
}

.exercise-nav li:last-child {
    margin-bottom: 0;
}

.exercise-dropdown {
    margin-bottom: 20px;
    background: rgba(255,255,255,0.02);
    border-left: 4px solid #a531cf;
    border-radius: 4px;
    overflow: hidden;
}

.exercise-dropdown summary {
    cursor: pointer;
    padding: 18px 22px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    list-style: none;
    background: rgba(255,255,255,0.03);
    transition: background 0.2s ease;
}

.exercise-dropdown summary:hover {
    background: rgba(255,255,255,0.06);
}

.exercise-dropdown summary::-webkit-details-marker {
    display: none;
}

.exercise-dropdown summary::after {
    display: none;
}

.toggle-icon {
    float: right;
    font-size: 22px;
    line-height: 1;
    color: #a531cf;
}

.toggle-icon::before {
    content: "+";
}

.exercise-dropdown[open] .toggle-icon::before {
    content: "?";
}

.exercise-content {
    padding: 22px;
}

.exercise-content p {
    margin-bottom: 15px;
}

.example-box {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(165,49,207,0.6);
    background: rgba(255,255,255,0.02);
}

.example-box h6 {
    margin-bottom: 12px;
    font-weight: 700;
}

.criteria-list {
    margin: 15px 0;
    padding-left: 20px;
}

.criteria-list li {
    list-style: disc !important;
    margin-bottom: 6px;
}

code.expression {
    display: block;
    margin-top: 10px;
    padding: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(165,49,207,0.5);
    color: #ffffff;
    white-space: pre-wrap;
}

/* ── Hints-panel action row (holds both hints-toggle and debug-toggle) ── */

.panel-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Debugger toggle button ── */

.debug-toggle {
    background: none;
    border: 1px solid rgba(240,140,40,0.5);
    color: #f08c28;
    padding: 8px 20px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    font-family: "Roboto", sans-serif;
    letter-spacing: 0.3px;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.debug-toggle:hover {
    background: rgba(240,140,40,0.12);
    border-color: #f08c28;
    color: #f0a850;
}

.debug-toggle.open {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.5);
}

.debug-action-group {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.debug-warning-text {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid rgba(240,140,40,0.24);
    border-radius: 3px;
    background: rgba(240,140,40,0.06);
    color: rgba(240,140,40,0.9);
    font-size: 13px;
    line-height: 1.35;
}

.exercise-action-row .debug-warning-text {
    display: none;
}

.debug-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,0.68);
}

.debug-confirm-modal.open {
    display: flex;
}

.debug-confirm-box {
    width: min(420px, 100%);
    padding: 28px;
    border: 1px solid rgba(240,140,40,0.35);
    border-radius: 4px;
    background: #111111;
    box-shadow: 0 22px 55px rgba(0,0,0,0.45);
    text-align: center;
}

.debug-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border: 1px solid rgba(240,140,40,0.36);
    border-radius: 50%;
    background: rgba(240,140,40,0.08);
    color: #f08c28;
    font-size: 18px;
}

.debug-confirm-box h3 {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: 21px;
    font-weight: 500;
}

.debug-confirm-box p {
    margin: 0;
    color: rgba(255,255,255,0.68);
    font-size: 15px;
    line-height: 1.55;
}

.debug-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.debug-confirm-primary,
.debug-confirm-secondary {
    min-width: 132px;
    border-radius: 3px;
    padding: 8px 16px;
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.debug-confirm-primary {
    border: 1px solid rgba(240,140,40,0.62);
    background: rgba(240,140,40,0.12);
    color: #f08c28;
}

.debug-confirm-primary:hover,
.debug-confirm-primary:focus {
    border-color: #f08c28;
    background: rgba(240,140,40,0.2);
    color: #f0a850;
}

.debug-confirm-secondary {
    border: 1px solid rgba(255,255,255,0.14);
    background: transparent;
    color: rgba(255,255,255,0.58);
}

.debug-confirm-secondary:hover,
.debug-confirm-secondary:focus {
    border-color: rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.05);
    color: #ffffff;
}

/* ── Debugger panel ── */

.debug-panel {
    display: none;
    margin-top: 20px;
    border: 1px solid rgba(240,140,40,0.2);
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0,0,0,0.2);
}

.debug-panel.open {
    display: block;
}

.debug-header {
    background: rgba(240,140,40,0.07);
    border-bottom: 1px solid rgba(240,140,40,0.15);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.debug-header-title {
    font-size: 11px;
    font-weight: 700;
    color: #f08c28;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    flex: 1;
}

.debug-example-btn {
    background: none;
    border: 1px solid rgba(240,140,40,0.3);
    color: rgba(240,140,40,0.65);
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
    font-family: "Roboto", sans-serif;
    transition: all 0.2s;
}

.debug-example-btn:hover,
.debug-example-btn.active {
    background: rgba(240,140,40,0.14);
    border-color: #f08c28;
    color: #f08c28;
}

.debug-body {
    display: grid;
    grid-template-columns: 1fr 260px;
}

@media (max-width: 700px) {
    .debug-body { grid-template-columns: 1fr; }
}

.debug-code-area {
    border-right: 1px solid rgba(255,255,255,0.06);
    padding: 14px 0;
    overflow-x: auto;
}

.debug-code-label,
.debug-vars-label,
.debug-console-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.28);
    padding: 0 14px 8px;
    display: block;
}

.debug-line {
    display: flex;
    align-items: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12.5px;
    line-height: 1.8;
    color: #909090;
    white-space: pre;
    padding: 0 14px;
    min-height: 23px;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}

.debug-line-num {
    display: inline-block;
    min-width: 26px;
    color: rgba(255,255,255,0.18);
    user-select: none;
    text-align: right;
    margin-right: 14px;
    flex-shrink: 0;
    font-size: 11px;
}

.debug-line.active {
    background: rgba(240,140,40,0.1);
    color: #fff;
    border-left-color: #f08c28;
}

.debug-line.active .debug-line-num {
    color: #f08c28;
}

.debug-right {
    display: flex;
    flex-direction: column;
}

.debug-vars-area {
    padding: 14px 0 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex: 1;
    min-height: 100px;
}

.debug-vars-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.debug-vars-table th {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    text-align: left;
    padding: 3px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.debug-vars-table td {
    padding: 4px 14px;
    font-family: 'Courier New', Courier, monospace;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}

.debug-var-name { color: #82aaff; }
.debug-var-type { color: rgba(255,255,255,0.28); font-size: 11px; }
.debug-var-value { color: #c3e88d; }

.debug-var-new {
    animation: varPop 0.8s ease;
}

@keyframes varPop {
    0%   { background: rgba(240,140,40,0.28); }
    100% { background: transparent; }
}

.debug-console-area {
    padding: 14px 0 14px;
}

.debug-console-output {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12.5px;
    line-height: 1.65;
    color: #d4d4d4;
    min-height: 56px;
    background: rgba(0,0,0,0.25);
    padding: 10px 14px;
    margin: 0 14px;
    border-radius: 2px;
    white-space: pre-wrap;
    word-break: break-all;
}

.debug-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.1);
}

.debug-note {
    font-size: 13px;
    color: #aaa;
    min-height: 40px;
    margin-bottom: 12px;
    line-height: 1.55;
}

.debug-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.debug-step-info {
    font-size: 12px;
    color: rgba(255,255,255,0.28);
    flex: 1;
}

.debug-prev-btn,
.debug-next-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.45);
    padding: 6px 16px;
    cursor: pointer;
    font-size: 13px;
    font-family: "Roboto", sans-serif;
    border-radius: 3px;
    transition: all 0.2s;
}

.debug-prev-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

.debug-prev-btn:disabled,
.debug-next-btn:disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

.debug-next-btn {
    border-color: rgba(240,140,40,0.4);
    color: #f08c28;
}

.debug-next-btn:hover {
    background: rgba(240,140,40,0.1);
    border-color: #f08c28;
    color: #f0a850;
}

/* ── end debugger ── */
