/* LDPC Rate Matching - 3GPP 38.212 §5.4.2 - Local styles */
#content_sim .rm-wrap { max-width: min(800px, 100%); margin: 0 auto; font-family: "Courier New", monospace; background: #000; color: #eee; padding: 12px; box-sizing: border-box; overflow-x: hidden; }
#content_sim .rm-title { font-size: 14px; margin-bottom: 10px; color: #eee; }
#content_sim .rm-control-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; color: #eee; }
#content_sim .rm-control-row label { min-width: 60px; color: #eee; }
#content_sim .rm-legend { color: #eee; }
#content_sim .rm-control-row input[type="number"] { width: 70px; font-family: "Courier New", monospace; background: #222; color: #eee; border: 1px solid #444; }
#content_sim .rm-control-row select { font-family: "Courier New", monospace; background: #222; color: #eee; border: 1px solid #444; }
#content_sim .rm-btn { font-family: "Courier New", monospace; padding: 6px 12px; cursor: pointer; background: #333; color: #fff; border: 1px solid #555; position: relative; z-index: 2; pointer-events: auto; }
#content_sim .rm-btn:hover { background: #444; }
#content_sim .rm-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 0; font-size: 12px; }
#content_sim .rm-legend-item { display: inline-flex; align-items: center; gap: 6px; }
#content_sim .rm-legend-swatch { width: 14px; height: 14px; border-radius: 2px; }
#content_sim .rm-legend-swatch.sys { background: #2ecc71; }
#content_sim .rm-legend-swatch.par { background: #3498db; }
#content_sim .rm-legend-swatch.punc { background: #e74c3c; }
#content_sim .rm-legend-swatch.fill { background: #95a5a6; }
#content_sim .rm-legend-swatch.sel { background: rgba(241, 196, 15, 0.6); border: 1px solid #f1c40f; }
/* Key parameters (Ncb, k0, E) description */
#content_sim .rm-params-desc { margin: 10px 0 14px 0; padding: 10px 12px; border: 1px solid #333; background: #0d0d0d; font-size: 12px; color: #ddd; }
#content_sim .rm-params-desc .rm-desc-head { font-size: 12px; margin: 0 0 8px 0; color: #f1c40f; font-weight: normal; }
#content_sim .rm-params-list { margin: 0; padding-left: 0; list-style: none; }
#content_sim .rm-params-list dt { font-weight: bold; color: #f1c40f; margin-top: 10px; margin-bottom: 2px; font-size: 13px; }
#content_sim .rm-params-list dt:first-child { margin-top: 0; }
#content_sim .rm-params-list dd { margin: 0 0 0 0; padding-left: 0; line-height: 1.4; }
/* Bit Selection section: colored-block description */
#content_sim .rm-bitselect-desc { margin: 10px 0 12px 0; padding: 10px 12px; border: 1px solid #333; background: #0d0d0d; font-size: 12px; color: #ddd; }
#content_sim .rm-bitselect-desc .rm-desc-head { font-size: 12px; margin: 0 0 8px 0; color: #f1c40f; font-weight: normal; }
#content_sim .rm-bitselect-desc .rm-desc-list { margin: 0 0 8px 0; padding-left: 20px; line-height: 1.45; }
#content_sim .rm-bitselect-desc .rm-desc-list li { margin-bottom: 6px; }
#content_sim .rm-bitselect-desc .rm-desc-summary { margin: 0; padding-top: 6px; border-top: 1px solid #333; font-size: 11px; color: #bdc3c7; }
#content_sim #rm-buffer-container { position: relative; width: 100%; max-width: 100%; min-height: 200px; border: 1px solid #444; background: #111; margin: 10px 0; overflow-x: auto; box-sizing: border-box; }
#content_sim #rm-buffer-container canvas { display: block; max-width: 100%; }
#content_sim .rm-summary { margin: 10px 0; padding: 10px; border: 1px solid #444; background: #1a1a1a; font-size: 12px; color: #eee; }
#content_sim .rm-summary table { width: 100%; border-collapse: collapse; }
#content_sim .rm-summary th, #content_sim .rm-summary td { text-align: left; padding: 4px 8px; border-bottom: 1px solid #333; color: #eee; }
#content_sim .rm-summary td.rm-how { font-size: 11px; color: #bdc3c7; max-width: 320px; word-wrap: break-word; }
#content_sim .rm-interleaver-section { margin: 12px 0; color: #eee; }
#content_sim .rm-interleaver-section h4 { font-size: 12px; margin-bottom: 6px; color: #eee; }
#content_sim .rm-interleaver-wrap { overflow-x: auto; max-width: 800px; margin-bottom: 8px; }
#content_sim .rm-interleaver-table { border-collapse: collapse; font-size: 11px; color: #eee; }
#content_sim .rm-interleaver-table th { padding: 4px; border: 1px solid #444; background: #222; color: #eee; }
#content_sim .rm-interleaver-cell { width: 22px; min-width: 22px; padding: 2px; text-align: center; border: 1px solid #444; color: #fff; }
#content_sim .rm-interleaver-cell.rm-bit { background: #1a4a1a; color: #7fdb8f; }
#content_sim .rm-interleaver-cell.rm-filler { background: #3a3a3a; color: #bdc3c7; }
#content_sim .rm-output-section { margin: 12px 0; color: #eee; }
#content_sim .rm-output-section h4 { color: #eee; }
#content_sim .rm-output-wrap { display: flex; flex-wrap: wrap; gap: 2px; font-size: 11px; margin-top: 6px; max-width: 100%; box-sizing: border-box; }
#content_sim .rm-output-bit { display: inline-block; min-width: 14px; padding: 2px 4px; text-align: center; background: #222; border: 1px solid #444; color: #eee; }
#content_sim .rm-output-bit.rm-output-bit-current { background: rgba(241, 196, 15, 0.5); border-color: #f1c40f; color: #fff; box-shadow: 0 0 6px rgba(241, 196, 15, 0.8); }
#content_sim #rmOutputBits .rm-output-bit.rm-output-bit-current { background: rgba(241, 196, 15, 0.6); box-shadow: 0 0 10px rgba(241, 196, 15, 0.9); }
/* Sliders */
#content_sim .rm-control-panel { margin-bottom: 10px; }
#content_sim .rm-control-row input[type="range"] { width: 120px; vertical-align: middle; }
#content_sim .rm-val { min-width: 28px; display: inline-block; color: #eee; }
#content_sim .rm-control-row .rm-prb-slider { width: 120px; }
#content_sim .rm-control-row input[type="checkbox"] { margin: 0 6px 0 0; }
/* Interleaver animation */
#content_sim .rm-interleaver-cell.rm-cell-empty { background: #1a1a1a; color: #555; }
#content_sim .rm-interleaver-cell.rm-cell-writing { background: rgba(241, 196, 15, 0.5); border-color: #f1c40f; color: #fff; box-shadow: 0 0 8px rgba(241, 196, 15, 0.8); }
#content_sim .rm-interleaver-cell.rm-cell-reading { background: rgba(230, 126, 34, 0.5); border-color: #e67e22; color: #fff; box-shadow: 0 0 6px rgba(230, 126, 34, 0.8); }
/* Block titles */
#content_sim .rm-block { margin: 14px 0; padding-top: 8px; border-top: 1px solid #333; }
#content_sim .rm-block-title { font-size: 14px; margin: 0 0 8px 0; color: #f1c40f; }
#content_sim .rm-block-desc { font-size: 11px; margin-bottom: 6px; color: #bdc3c7; }
/* Spec tables (LBRM, k0) */
#content_sim .rm-spec-tables { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0; }
#content_sim .rm-spec-table-wrap { flex: 1; min-width: 200px; }
#content_sim .rm-spec-caption { font-size: 11px; margin-bottom: 4px; color: #bdc3c7; }
#content_sim .rm-spec-table { border-collapse: collapse; font-size: 11px; width: 100%; color: #eee; }
#content_sim .rm-spec-table th, #content_sim .rm-spec-table td { padding: 4px 8px; border: 1px solid #444; text-align: left; }
#content_sim .rm-spec-table th { background: #222; }
#content_sim .rm-lbrm-row.rm-active, #content_sim .rm-k0-row.rm-active { background: rgba(241, 196, 15, 0.25); outline: 1px solid #f1c40f; }
#content_sim .rm-input-notation { font-size: 12px; color: #bdc3c7; margin: 4px 0 8px 0; }
#content_sim .rm-input-bits-wrap { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
#content_sim .rm-input-bits-label { color: #eee; white-space: nowrap; }
#content_sim .rm-input-bits .rm-output-wrap { display: inline-flex; flex-wrap: wrap; gap: 2px; }
#content_sim .rm-spec-frame { margin: 10px 0; }
#content_sim .rm-spec-frame-upper { margin-bottom: 14px; }
#content_sim .rm-spec-frame-lower .rm-spec-caption { margin-bottom: 6px; }
#content_sim .rm-k0-cell { color: #eee; white-space: nowrap; }
#content_sim .rm-k0-cell span { font-weight: bold; }
/* Animation status panel (step detail) */
#content_sim .rm-status-panel { margin: 12px 0; padding: 10px; border: 1px solid #333; background: #0d0d0d; }
#content_sim .rm-status-panel .rm-status-head { font-size: 12px; margin: 0 0 8px 0; color: #f1c40f; }
#content_sim .rm-status-msg { background: #1a1a1a; color: #f1c40f; padding: 10px; margin: 5px 0; border-left: 4px solid #f1c40f; font-family: "Courier New", monospace; font-size: 12px; min-height: 1.2em; }
#content_sim .rm-status-msg.rm-status-inline { margin: 8px 0 10px 0; }
