/**
 * FEA 2D – Linear Triangle (T3) simulation
 * Scoped styles; dark theme; sidebar + canvas.
 */
#content_sim #fea-simulation,
#fea-simulation {
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
}

#content_sim .fea-container,
#fea-simulation .fea-container {
    font-family: 'Inter', 'Courier New', Courier, monospace;
    width: 100%;
    max-width: 800px;
    margin: 0;
    padding: 12px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #f8fafc;
    box-sizing: border-box;
    border-radius: 8px;
    overflow: hidden;
}

#content_sim .fea-container,
#fea-simulation .fea-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

#content_sim .fea-top,
#fea-simulation .fea-top {
    display: flex;
    flex-direction: row;
    gap: 12px;
    min-width: 0;
    flex-shrink: 0;
    min-height: 510px;
}

#content_sim .fea-math-monitor,
#fea-simulation .fea-math-monitor {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
    padding: 12px;
    border-top: 1px solid #334155;
    background: rgba(15, 23, 42, 0.8);
    margin-top: 0;
}

#content_sim .fea-equation-box,
#fea-simulation .fea-equation-box {
    padding: 10px 14px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid #334155;
    border-radius: 6px;
    min-width: 200px;
}

#content_sim .fea-eq-title,
#fea-simulation .fea-eq-title {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    margin-bottom: 6px;
}

#content_sim .fea-eq-main,
#fea-simulation .fea-eq-main {
    font-size: 20px;
    margin: 0 0 10px 0;
    color: #ffffff;
}

#content_sim .fea-eq-legend,
#fea-simulation .fea-eq-legend {
    font-size: 13px;
    color: #ffffff;
    margin: 0;
    line-height: 1.5;
}

#content_sim .fea-eq-dims,
#fea-simulation .fea-eq-dims {
    font-size: 12px;
    color: #94a3b8;
    margin: 6px 0 0 0;
    line-height: 1.4;
}
#content_sim .fea-eq-dims span,
#fea-simulation .fea-eq-dims span {
    font-family: 'Courier New', Courier, monospace;
    color: #e2e8f0;
}

#content_sim .fea-eq-info,
#fea-simulation .fea-eq-info {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #334155;
}

#content_sim .fea-eq-info-head,
#fea-simulation .fea-eq-info-head {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 4px 0;
}

#content_sim .fea-eq-info-item,
#fea-simulation .fea-eq-info-item {
    font-size: 11px;
    color: #cbd5e1;
    line-height: 1.4;
    margin: 0 0 6px 0;
}

#content_sim .fea-eq-info-item:last-child,
#fea-simulation .fea-eq-info-item:last-child {
    margin-bottom: 0;
}

#content_sim .fea-monitor,
#fea-simulation .fea-monitor {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
}

#content_sim .fea-matrix-column,
#fea-simulation .fea-matrix-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#content_sim .fea-matrix-column label,
#fea-simulation .fea-matrix-column label {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#content_sim .fea-math-operator,
#fea-simulation .fea-math-operator {
    font-size: 20px;
    color: #64748b;
    align-self: center;
    margin-top: 4px;
}

#content_sim .fea-matrix-wrap,
#fea-simulation .fea-matrix-wrap {
    position: relative;
    display: inline-block;
}

#content_sim .fea-eq-k-trigger,
#fea-simulation .fea-eq-k-trigger {
    cursor: pointer;
    padding: 0 2px;
    font-style: italic;
    transition: color 0.3s, text-shadow 0.3s;
}
#content_sim .fea-eq-k-trigger:hover,
#fea-simulation .fea-eq-k-trigger:hover {
    color: #60a5fa;
    text-shadow: 0 0 10px #60a5fa;
}

#content_sim .fea-matrix-stats,
#fea-simulation .fea-matrix-stats {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 6px;
}
#content_sim .fea-matrix-stats span,
#fea-simulation .fea-matrix-stats span {
    color: #e2e8f0;
    font-family: 'Courier New', Courier, monospace;
}

#content_sim #matrix-K-canvas,
#fea-simulation #matrix-K-canvas,
#content_sim #matrix-d-canvas,
#fea-simulation #matrix-d-canvas,
#content_sim #matrix-fext-canvas,
#fea-simulation #matrix-fext-canvas,
#content_sim #matrix-fp-canvas,
#fea-simulation #matrix-fp-canvas {
    display: block;
    border: 1px solid #334155;
    border-radius: 4px;
    background: #020617;
}
#content_sim #matrix-K-canvas,
#fea-simulation #matrix-K-canvas {
    cursor: crosshair;
    transition: filter 0.15s ease-out;
}
#content_sim #matrix-K-canvas.matrix-glow,
#fea-simulation #matrix-K-canvas.matrix-glow {
    filter: drop-shadow(0 0 8px #60a5fa);
}

#content_sim .fea-matrix-readout,
#fea-simulation .fea-matrix-readout {
    display: none;
    position: absolute;
    left: 0;
    top: -22px;
    font-size: 11px;
    color: #fbbf24;
    background: #0f172a;
    padding: 4px 8px;
    border: 1px solid #334155;
    border-radius: 4px;
    pointer-events: none;
    white-space: nowrap;
}

#content_sim .fea-sidebar,
#fea-simulation .fea-sidebar {
    width: 220px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid #334155;
    padding: 10px;
    border-radius: 6px;
}

#content_sim .fea-sidebar h2,
#fea-simulation .fea-sidebar h2 {
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#content_sim .fea-control-row,
#fea-simulation .fea-control-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#content_sim .fea-control-row label,
#fea-simulation .fea-control-row label {
    min-width: 120px;
    font-size: 11px;
    color: #94a3b8;
}

#content_sim .fea-control-row input[type="number"],
#content_sim .fea-control-row select,
#fea-simulation .fea-control-row input[type="number"],
#fea-simulation .fea-control-row select {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #334155;
    border-radius: 4px;
    color: #e2e8f0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    outline: none;
}

#content_sim .fea-slider-row .fea-slider-wrap,
#fea-simulation .fea-slider-row .fea-slider-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

#content_sim .fea-slider-row input[type="range"],
#fea-simulation .fea-slider-row input[type="range"] {
    flex: 1;
    min-width: 60px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 3px;
    outline: none;
}

#content_sim .fea-slider-row input[type="range"]::-webkit-slider-thumb,
#fea-simulation .fea-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #10b981;
    border: 1px solid #334155;
    cursor: pointer;
}

#content_sim .fea-slider-row input[type="range"]::-moz-range-thumb,
#fea-simulation .fea-slider-row input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #10b981;
    border: 1px solid #334155;
    cursor: pointer;
}

#content_sim .fea-readout,
#fea-simulation .fea-readout {
    min-width: 44px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    color: #e2e8f0;
}

#content_sim .fea-btn-reset,
#fea-simulation .fea-btn-reset {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #475569;
    border-radius: 4px;
    color: #94a3b8;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    cursor: pointer;
}

#content_sim .fea-btn-reset:hover,
#fea-simulation .fea-btn-reset:hover {
    background: rgba(71, 85, 105, 0.5);
    color: #e2e8f0;
}

#content_sim .fea-btn-clear,
#fea-simulation .fea-btn-clear {
    background-color: #334155;
    color: #fff;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 8px;
    width: 100%;
    transition: background 0.2s;
}

#content_sim .fea-btn-clear:hover,
#fea-simulation .fea-btn-clear:hover {
    background-color: #475569;
}

#content_sim .fea-hint,
#fea-simulation .fea-hint {
    font-size: 10px;
    color: #64748b;
    margin: 0;
}

#content_sim .fea-canvas-wrap,
#fea-simulation .fea-canvas-wrap {
    flex: 1;
    min-width: 0;
    min-height: 480px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #020617;
}

#content_sim #fea-canvas,
#fea-simulation #fea-canvas {
    display: block;
    border: 1px solid #334155;
    border-radius: 4px;
    cursor: crosshair;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    margin-top: -10px;
}
