/* ==========================================================================
   GEOMETRIE COMPOSEE - DESIGN SYSTEM (VANILLA CSS)
   Aesthetic: Classic School Mathematics Workbook / Printed Textbook
   High-contrast, crisp line-art borders, ink colors, and tactile stationery keys.
   ========================================================================== */

:root {
    /* Fonts - classic printed handbook look coupled with clean numeric mono */
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-secondary: 'Plus Jakarta Sans', sans-serif;
    --font-math: 'EB Garamond', Georgia, serif;
    --font-mono: 'JetBrains Mono', Courier, monospace;

    /* Theme Colors - Light Mode Textbook (Ivory page base, solid ink lines) */
    --bg-app: #faf9f6;
    /* Warm math paper cream */
    --bg-card: #ffffff;
    /* Crisp white sheet overlays */
    --bg-card-hover: #fcfbf9;

    --border-card: #2d3748;
    /* Slate graphite pencil line */
    --border-card-hover: #1e293b;
    --text-main: #1e293b;
    /* Charcoal ink */
    --text-muted: #475569;
    /* Graphite grey */
    --text-light: #ffffff;

    /* Ink & Marker Palette */
    --color-primary: #0f4c81;
    /* Classic fountain pen ink blue */
    --color-primary-light: #f0f4f8;
    /* Diluted blue wash */
    --color-primary-dark: #092f52;

    --color-secondary: #475569;
    /* Slate pencil grey */
    --color-secondary-light: #f8fafc;

    --color-success: #16a34a;
    /* Teacher validation green ink */
    --color-success-light: #f0fdf4;
    --color-danger: #dc2626;
    /* Teacher correction red ink */
    --color-danger-light: #fee2e2;
    --color-warning: #ea580c;
    /* Alert orange marker */
    --color-warning-light: #fff7ed;

    /* SVG Colors */
    --grid-color: rgba(15, 76, 129, 0.08);
    /* Soft blue grid lines */
    --shape-fill-opacity: 0.35;
    /* Translucent felt-tip marker fills */
    --shape-stroke-width: 3.5px;
    --cote-color: #2d3748;
    --cote-line-width: 1.5px;
    --cote-font-size: 13.5px;

    /* Highlighter marker colors for geometry subshapes */
    --color-sh-rect: #3b82f6;
    /* Blue highlighter */
    --color-sh-tri: #22c55e;
    /* Green highlighter */
    --color-sh-circle: #fb923c;
    /* Orange highlighter */
    --color-sh-qcircle: #ef4444;
    /* Pink/Red highlighter */
    --color-sh-tricon: #a855f7;
    /* Purple highlighter */

    /* Snappy paper interactions, no sluggish animations */
    --transition-fast: 0.05s ease;
    --transition-normal: 0.15s ease;
    --transition-slow: 0.3s ease;
}

/* Forced light mode body styles */
body.light-mode,
body {
    background: var(--bg-app);
    color: var(--text-main);
}

/* --- RESET & BASIC STYLES --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    /* Subtle ruled graph-paper (Seyès / petits carreaux) background */
    background-color: var(--bg-app);
    background-image:
        linear-gradient(rgba(15, 76, 129, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 76, 129, 0.035) 1px, transparent 1px);
    background-size: 20px 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- MAIN LAYOUT STRUCTURE --- */
.app-container {
    width: 100%;
    max-width: 1400px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: relative;
}

/* --- HEADER DESIGN --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 6px;
    padding: 0.8rem 1.5rem;
    margin-bottom: 1.2rem;
    z-index: 10;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
}

.logo-text h1 {
    font-family: var(--font-math);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-main);
}

.logo-text h1 span {
    color: var(--color-primary);
    font-style: italic;
}

.logo-sub {
    font-size: 0.72rem;
    font-family: var(--font-primary);
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
    letter-spacing: 0.02em;
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.control-label {
    font-size: 0.68rem;
    font-family: var(--font-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-muted);
}

/* Segmented switch layout styled as worksheet tabs */
.toggle-switch,
.difficulty-selector {
    display: flex;
    background: var(--color-secondary-light);
    border-radius: 6px;
    padding: 2.5px;
    border: 1px solid var(--border-card);
}

.toggle-btn,
.diff-btn {
    border: none;
    background: transparent;
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.toggle-btn:hover,
.diff-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-main);
}

.toggle-btn.active,
.diff-btn.active {
    background: var(--color-primary);
    color: var(--text-light);
}

.diff-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Utility buttons */
.utility-controls {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background var(--transition-fast);
}

.icon-btn:hover {
    background: var(--color-primary-light);
}

.icon-btn:active {
    background: var(--border-card);
    color: var(--text-light);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

/* --- MAIN LAYOUT GRID --- */
.app-main {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr 340px;
    gap: 1.2rem;
    height: calc(100vh - 120px);
    min-height: 0;
    margin-bottom: 2rem;
}

/* --- SIDE & PANEL CARDS --- */
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.side-panel::-webkit-scrollbar {
    width: 4px;
}

.side-panel::-webkit-scrollbar-thumb {
    background: var(--border-card);
    border-radius: 4px;
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 6px;
    padding: 1.2rem;
}

.panel-title {
    font-family: var(--font-math);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.4rem;
    color: var(--text-main);
    border-bottom: 1px solid rgba(15, 76, 129, 0.1);
}

.panel-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 45px;
    height: 2px;
    background: var(--color-primary);
}

/* --- GAMIFICATION PANEL (Hidden by design) --- */
.config-card,
.gamification-card,
.badges-section {
    display: none !important;
}

/* --- MEMO FORMULAS CARD --- */
.memo-formulas {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.memo-item {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 4px;
    padding: 0.5rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.memo-name {
    font-family: var(--font-math);
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
}

.memo-value {
    font-family: var(--font-mono);
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.memo-section-title {
    font-family: var(--font-primary);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
    margin-bottom: 0.3rem;
    border-bottom: 1px solid rgba(15, 76, 129, 0.15);
    padding-bottom: 0.2rem;
}

.memo-section-title:first-of-type {
    margin-top: 0;
}

/* --- MONOCHROME MANUAL STYLE --- */
.geometry-svg.monochrome .geometry-subshape {
    fill: var(--text-muted) !important;
    fill-opacity: 0.08 !important;
    stroke: var(--text-main) !important;
}

.geometry-svg.monochrome .geometry-subshape:hover,
.geometry-svg.monochrome .geometry-subshape.highlighted {
    fill-opacity: 0.22 !important;
    fill: var(--text-main) !important;
    stroke: var(--text-main) !important;
}

.geometry-svg.monochrome .geometry-subshape.cutout {
    fill: transparent !important;
    fill-opacity: 0 !important;
    stroke-dasharray: 4 4 !important;
    stroke: var(--text-main) !important;
}

.geometry-svg.monochrome .geometry-subshape.cutout:hover,
.geometry-svg.monochrome .geometry-subshape.cutout.highlighted {
    fill: var(--text-main) !important;
    fill-opacity: 0.1 !important;
}

/* --- CENTER PANEL: INTERACTIVE CANVAS --- */
.center-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.figure-container-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 6px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

/* Drawing Toolbar styled as stationery box */
.slate-toolbar {
    display: flex;
    align-items: center;
    background: var(--color-primary-light);
    border: 1px solid var(--border-card);
    border-radius: 6px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 0.8rem;
}

.slate-tool {
    border: 1.5px solid transparent;
    background: transparent;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.slate-tool svg {
    width: 16px;
    height: 16px;
}

.slate-tool.active {
    background: var(--color-primary);
    color: var(--text-light);
    border-color: var(--border-card);
}

.slate-toolbar .divider {
    width: 2px;
    height: 20px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 4px;
}

.color-picker-group {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: 4px;
}

.color-dot {
    border: 1px solid var(--border-card);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.color-dot.active {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 3.5px var(--color-primary);
}

.slate-action-btn {
    margin-left: auto;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.slate-action-btn:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

/* Canvas board wrapper */
.canvas-wrapper {
    flex: 1;
    position: relative;
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: 6px;
    overflow: hidden;
    min-height: 0;
}

/* SVG Geometry element style */
.geometry-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slate-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    cursor: default;
}

.slate-canvas.active {
    pointer-events: auto;
    cursor: crosshair;
}

/* Floating helper bubble */
.interactive-hint-bubble {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 3;
}

/* --- GEOMETRIC SHAPES STYLING --- */
.geometry-subshape {
    fill-opacity: var(--shape-fill-opacity);
    stroke-width: var(--shape-stroke-width);
    stroke-linejoin: round;
    cursor: pointer;
    transition: fill-opacity var(--transition-normal);
}

.geometry-subshape:hover,
.geometry-subshape.highlighted {
    fill-opacity: 0.65 !important;
}

/* Highlight Color overrides */
.geometry-subshape.type-rect {
    fill: var(--color-sh-rect);
    stroke: var(--color-sh-rect);
}

.geometry-subshape.type-tri {
    fill: var(--color-sh-tri);
    stroke: var(--color-sh-tri);
}

.geometry-subshape.type-circle {
    fill: var(--color-sh-circle);
    stroke: var(--color-sh-circle);
}

.geometry-subshape.type-qcircle {
    fill: var(--color-sh-qcircle);
    stroke: var(--color-sh-qcircle);
}

.geometry-subshape.type-tricon {
    fill: var(--color-sh-tricon);
    stroke: var(--color-sh-tricon);
}

.geometry-subshape.cutout {
    fill-opacity: 0.05 !important;
    stroke-dasharray: 5 5;
}

.geometry-subshape.cutout:hover,
.geometry-subshape.cutout.highlighted {
    fill-opacity: 0.25 !important;
}

.shape-outline {
    fill: none;
    stroke: var(--text-main);
    stroke-width: 3px;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.shape-guideline {
    fill: none;
    stroke: var(--text-muted);
    stroke-dasharray: 4 4;
    stroke-width: 1.5px;
    pointer-events: none;
}

.shape-marking {
    fill: none;
    stroke: var(--text-main);
    stroke-width: 2px;
    pointer-events: none;
}

/* Dimensions indicators */
.dimension-line {
    stroke: var(--cote-color);
    stroke-width: var(--cote-line-width);
    marker-start: url(#arrow-start);
    marker-end: url(#arrow-end);
    pointer-events: none;
}

.dimension-extension {
    stroke: var(--text-muted);
    stroke-width: 1px;
    stroke-dasharray: 3 3;
    pointer-events: none;
    opacity: 0.5;
}

.dimension-text {
    font-family: var(--font-mono);
    font-size: var(--cote-font-size);
    font-weight: 700;
    fill: var(--cote-color);
    text-anchor: middle;
    paint-order: stroke;
    stroke: #ffffff;
    stroke-width: 4px;
    stroke-linejoin: round;
    pointer-events: none;
}

/* --- RIGHT PANEL: QUESTIONS AND INPUTS --- */
.question-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 100%;
}

.instruction-box {
    background: var(--color-primary-light);
    border: 1px solid var(--border-card);
    border-radius: 4px;
    padding: 0.8rem 1rem;

}

.instruction-text {
    font-family: var(--font-math);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);

}

.instruction-details {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-weight: 500;
}

/* INPUT FORM */
.input-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    padding: 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    transition: background var(--transition-fast), border var(--transition-fast);
}

.input-block:hover {
    background: rgba(0, 0, 0, 0.02);
}

.input-block.active {
    background: var(--color-primary-light);
    border: 1px solid var(--color-primary);
}

.input-block-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.input-block.active .input-block-label {
    color: var(--color-primary);
}

#formula-input,
#answer-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 4px;
    padding: 0.6rem 0.8rem;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    outline: none;
}

#formula-input:focus,
#answer-input:focus {
    border-color: var(--color-primary);
}

.formula-result-preview {
    position: relative;

    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--color-success);
    background: var(--color-success-light);
    border: 1px solid var(--color-success);
    padding: 2px 8px;
    border-radius: 4px;
    pointer-events: none;
}

.unit-label {
    position: absolute;
    right: 14px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* TACTILE VIRTUAL MATH KEYBOARD */
.math-keyboard {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
    background: var(--color-primary-light);
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-card);
}

.key-btn {
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.65rem 0;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.05s ease, transform 0.05s ease;
}

.key-btn:hover {
    background: var(--color-primary-light);
}

.key-btn:active {
    background: var(--border-card);
    color: var(--text-light);
}

.key-btn.op {
    background: #e0f2fe;
    color: #0369a1;
}

.key-btn.paren {
    background: #f1f5f9;
    color: var(--text-muted);
}

.key-btn.pi-key {
    background: #ccfbf1;
    color: #0f766e;
    font-size: 1.2rem;
}

.key-btn.danger {
    color: var(--color-danger);
    background: var(--bg-card);
}

.key-btn.danger:hover {
    background: var(--color-danger-light);
}

/* ACTION BUTTONS GROUP */
.action-buttons-group {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 0.6rem;
}

.btn {
    border: 1px solid var(--border-card);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 800;
    padding: 0.75rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.08s ease, background 0.08s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--color-primary);
    color: var(--text-light);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--color-primary-light);
}

.btn-new-figure {
    background: #f0fdfa;
    color: #0f766e;
    border: 1px dashed #0f766e;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    transition: transform 0.08s ease, background 0.08s ease;
}

.btn-new-figure:hover {
    background: #ccfbf1;
}

.btn-new-figure:active {
    transform: scale(0.98);
}

/* --- BOTTOM DRAWER: DETAILED CORRECTION --- */
.app-correction-drawer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(calc(100% - 45px));
    width: calc(100% - 3rem);
    max-width: 1350px;
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-correction-drawer.open {
    transform: translateX(-50%) translateY(0);
}

.drawer-header {
    height: 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--border-card);
    background: var(--color-secondary-light);
}

.header-indicator {
    width: 36px;
    height: 4px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
    margin-bottom: 2px;
}

.drawer-header .header-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-math);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
}

.drawer-icon {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-normal);
}

.app-correction-drawer.open .drawer-icon {
    transform: rotate(180deg);
}

.drawer-body {
    max-height: 420px;
    overflow-y: auto;
    padding: 1.5rem;
    background: #ffffff;
}

.correction-loading-state {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    padding: 2rem 0;
}

/* Correction Details Ruled Paper CSS */
.correction-block {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.correction-title {
    font-family: var(--font-math);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.correction-step {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 4px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: background var(--transition-fast);
}

.correction-step:hover {
    background: var(--color-primary-light);
}

.step-badge {
    background: var(--color-primary);
    color: var(--text-light);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    border: 1px solid var(--border-card);
}

.step-details {
    flex: 1;
}

.step-title {
    font-family: var(--font-math);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.3rem;
}

.step-formula {
    background: var(--color-primary-light);
    border-left: 2px solid var(--color-primary);
    padding: 0.35rem 0.7rem;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0.4rem 0;
    display: inline-block;
    color: var(--color-primary-dark);
}

.step-calc {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.step-result-banner {
    background: var(--color-success-light);
    border: 1px solid var(--color-success);
    color: var(--color-success);
    padding: 1rem;
    border-radius: 4px;
    font-family: var(--font-math);
    font-weight: 700;
    font-size: 1.15rem;
    text-align: center;
    margin-top: 0.8rem;
}

/* Success/Error states */
.state-success {
    background: var(--color-success-light) !important;
    border-color: var(--color-success) !important;
}

.state-success .step-badge {
    background: var(--color-success) !important;
}

.state-error {
    background: var(--color-danger-light) !important;
    border-color: var(--color-danger) !important;
}

.state-error .step-badge {
    background: var(--color-danger) !important;
}

/* Confetti particles */
.confetti-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    animation: fallConfetti linear forwards;
}

@keyframes fallConfetti {
    from {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }

    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1200px) {
    .app-main {
        grid-template-columns: 240px 1fr 280px;
        gap: 1rem;
    }
}

@media (max-width: 992px) {
    body {
        overflow-y: auto;
    }

    .app-container {
        height: auto;
        padding: 0.8rem;
    }

    .app-main {
        grid-template-columns: 1fr;
        height: auto;
        gap: 1.2rem;
    }

    .side-panel {
        overflow-y: visible;
        height: auto;
    }

    .canvas-wrapper {
        aspect-ratio: 5/4;
        height: 350px;
    }

    .app-correction-drawer {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 1.5rem;
        border-radius: 6px;
        border: 2px solid var(--border-card);
    }

    .app-correction-drawer.open {
        transform: none;
    }

    .drawer-header {
        cursor: default;
    }

    .drawer-icon {
        display: none;
    }

    .drawer-body {
        max-height: none;
    }
}

@media (max-width: 600px) {
    .app-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
        padding: 1rem;
    }

    .header-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .control-group {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .logo-area {
        justify-content: center;
    }

    .utility-controls {
        justify-content: center;
    }
}

/* --- SUIVI EVALUATION CARD --- */
.suivi-card {
    background: var(--bg-card);
    border: 2px solid var(--color-primary) !important;
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1.2rem;
}

.suivi-progress-section {
    margin-top: 0.8rem;
}

.suivi-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.progress-bar-bg {
    background: var(--border-card);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    width: 100%;
}

.progress-bar-fill {
    background: var(--color-primary);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}