/* LADDER Builder v1.4.1 Víðir - Components */

.ladder-container { flex: 1; overflow: auto; padding: 0.5rem; }
.ladder-grid { display: flex; flex-direction: column; min-width: 700px; }
.network { background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 0.4rem; }
.network-header { background: var(--bg-cell); padding: 0.25rem 0.5rem; display: flex; align-items: center; gap: 0.5rem; border-radius: 6px 6px 0 0; }
.network-number { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--primary); font-size: 0.75rem; }
.network-title { flex: 1; background: transparent; border: none; color: var(--text-primary); font-size: 0.75rem; padding: 0.15rem 0.3rem; }
.network-title:focus { outline: none; background: var(--bg-dark); border-radius: 3px; }
.network-delete { background: transparent; border: 1px solid var(--error); color: var(--error); padding: 0.15rem 0.35rem; border-radius: 3px; font-size: 0.8rem; cursor: pointer; margin-left: 30px; }
.network-add-btn { background: transparent; border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; font-size: 0.55rem; padding: 0.15rem 0.3rem; border-radius: 3px; font-family: 'JetBrains Mono', monospace; }
.network-add-btn:hover { border-color: var(--success); color: var(--success); background: rgba(34,197,94,0.1); }
.network-body { padding: 0.5rem; }
.ladder-canvas { position: relative; min-height: 50px; }
.ladder-canvas.has-branch { min-height: 110px; }
.ladder-canvas svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.ladder-canvas svg line { stroke: var(--wire); stroke-width: 2; }
.ladder-canvas svg line.active { stroke: var(--wire-active); filter: drop-shadow(0 0 3px rgba(34,197,94,0.5)); }
.ladder-row { display: flex; align-items: center; height: 46px; position: relative; z-index: 2; }
.power-rail { width: 4px; height: 46px; background: var(--wire); border-radius: 2px; }
.power-rail.active { background: var(--wire-active); }
.ladder-cells { display: flex; flex: 1; height: 100%; align-items: center; }
.ladder-cell { width: 92px; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.ladder-cell.output-cell { width: 80px; background: rgba(234,179,8,0.08); border-radius: 4px; margin-left: 4px; }
.ladder-cell.drop-target { background: rgba(0,102,204,0.15); border-radius: 4px; }
.ladder-cell.counter-target { background: rgba(168,85,247,0.25); border-radius: 4px; outline: 2px dashed var(--purple); outline-offset: -2px; animation: counterPulse 0.8s ease-in-out infinite; }
.ladder-cell.cursor { background: rgba(0,102,204,0.12); border-radius: 4px; outline: 1px dashed rgba(0,102,204,0.4); outline-offset: -1px; }
.ladder-cell.cursor::before { content: '▼'; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); color: var(--primary); font-size: 10px; animation: cursorBlink 0.8s ease-in-out infinite; }
.branch-row { display: flex; align-items: center; height: 46px; position: relative; z-index: 1; margin-left: 4px; margin-top: 6px; }
.branch-spacer { flex-shrink: 0; }
.branch-cells { display: flex; height: 100%; align-items: center; position: relative; }
.branch-cell { width: 92px; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.branch-cell.cursor { background: rgba(0,102,204,0.12); border-radius: 4px; outline: 1px dashed rgba(0,102,204,0.4); outline-offset: -1px; }
.branch-cell.cursor::before { content: '▼'; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); color: var(--primary); font-size: 10px; animation: cursorBlink 0.8s ease-in-out infinite; }
.branch-controls { position: absolute; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 1px; z-index: 10; background: var(--bg-card); padding: 2px; border-radius: 3px; border: 1px solid var(--border); }
.branch-controls .branch-arrow-row { display: flex; gap: 1px; }
.branch-controls.start-controls { left: -22px; }
.branch-controls.end-controls { right: -22px; }
.branch-btn { width: 16px; height: 16px; background: var(--primary); border: none; border-radius: 2px; color: white; font-size: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.branch-btn.delete { background: var(--error); }
.branch-btn.add { background: var(--success); font-weight: bold; }
.branch-btn:disabled { opacity: 0.3; }
.cell-component { background: var(--bg-card); border: 2px solid var(--border); border-radius: 4px; padding: 0.15rem 0.2rem; min-width: 54px; text-align: center; cursor: pointer; z-index: 3; }
.cell-component:hover { border-color: var(--primary); }
.cell-component.dragging { opacity: 0.3; }
.cell-component.selected { border-color: #ff6b35; box-shadow: 0 0 8px rgba(255,107,53,0.4); }
.cell-component.active { background: rgba(34,197,94,0.2); border-color: var(--success); }

/* contact-energized: IO er HIGH en straumur fer ekki endilega í gegn.
   Kennslulegt: nemandi sér að snerta er virk en series logic blokkar.
   NO snerta (contact-make) + energized: amber/gult = "lokuð, bíður eftir straum"
   NC snerta (contact-break) + energized: rauðara = "opin vegna IO HIGH"         */
.cell-component.contact-make.contact-energized:not(.active) {
    border-color: var(--warning);
    background: rgba(234,179,8,0.12);
    box-shadow: 0 0 6px rgba(234,179,8,0.35);
}
.cell-component.contact-make.contact-energized:not(.active) .component-symbol {
    color: var(--warning);
}
.cell-component.contact-break.contact-energized {
    border-color: #f97316;
    background: rgba(249,115,22,0.12);
    box-shadow: 0 0 5px rgba(249,115,22,0.3);
}
.cell-component.contact-break.contact-energized .component-symbol {
    color: #f97316;
}
.cell-component .component-symbol { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; font-weight: 600; line-height: 1.1; }
.cell-component .component-label { font-size: 0.55rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.cell-component .component-comment { font-size: 0.5rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.1; }
.cell-component.contact-make .component-symbol { color: var(--success); }
.cell-component.contact-break .component-symbol { color: var(--error); }
.cell-component.coil-normal .component-symbol { color: var(--warning); }
.cell-component.coil-set .component-symbol { color: var(--success); }
.cell-component.coil-reset .component-symbol { color: var(--error); }
.cell-component.timer-ton, .cell-component.timer-tof { padding: 0.1rem; min-width: 0; max-width: 88px; width: 88px; align-self: flex-start; box-sizing: border-box; background: rgba(6,182,212,0.08); }
.cell-component.timer-ton .component-symbol, .cell-component.timer-tof .component-symbol { color: var(--cyan); }
.cell-component[data-io-type="M"] { border-color: var(--purple); }
.cell-component[data-io-type="M"].active { border-color: var(--success); background: rgba(34,197,94,0.25); }
.cell-component[data-io-type="M"] .component-label { color: var(--purple); }
.cell-component[data-io-type="Q"] { border-color: var(--warning); background: rgba(234,179,8,0.1); }
.cell-component[data-io-type="Q"].active { border-color: var(--success); background: rgba(34,197,94,0.25); }
.cell-component[data-io-type="T"] { border-color: var(--cyan); background: rgba(6,182,212,0.05); }
.cell-component[data-io-type="T"].active { border-color: var(--success); background: rgba(34,197,94,0.25); }
.cell-component[data-io-type="C"] { border-color: var(--purple); background: rgba(168,85,247,0.08); }
.cell-component[data-io-type="C"].active { border-color: var(--success); background: rgba(34,197,94,0.25); }
.cell-component[data-io-type="A"] { border-color: #f97316; background: rgba(249,115,22,0.08); }
.cell-component[data-io-type="A"].active { border-color: var(--success); background: rgba(34,197,94,0.25); }
.cell-component.counter { padding: 0; min-width: 88px; max-width: 88px; align-self: flex-start; margin-top: 0; overflow: hidden; }
/* Counter v2 - D og R inni í blokk */
.counter-block-v2 { display: flex; flex-direction: column; width: 100%; font-family: 'JetBrains Mono', monospace; }
.cnt-header { display: flex; justify-content: space-between; align-items: center; padding: 0.1rem 0.2rem; border-bottom: 1px solid var(--purple); }
.cnt-type { font-size: 0.6rem; font-weight: 600; color: var(--purple); }
.cnt-name { font-size: 0.65rem; color: var(--text-primary); font-weight: 700; }
.cnt-values { padding: 0.05rem 0.2rem; }
.cnt-val-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.6rem; }
.cnt-lbl { color: var(--text-muted); }
.cnt-val { color: var(--purple); font-weight: 600; }
.cnt-val.active { color: var(--success); }
.cnt-op { color: var(--text-muted); font-size: 0.5rem; }
.cnt-bar { height: 2px; background: var(--border); border-radius: 2px; margin: 0.05rem 0.2rem; }
.cnt-bar-fill { height: 100%; background: var(--purple); border-radius: 2px; transition: width 0.1s; }
.cnt-bar-fill.complete { background: var(--success); }
.cnt-io-row { display: flex; align-items: center; gap: 0.15rem; padding: 0.1rem 0.2rem; border-top: 1px solid var(--border); transition: background 0.1s; }
.cnt-io-row.active { background: rgba(34,197,94,0.1); }
.cnt-io-pin { font-size: 0.6rem; font-weight: 700; color: var(--purple); width: 12px; }
.cnt-io-val { font-size: 0.6rem; color: var(--text-secondary); flex: 1; }
.cnt-io-state { font-size: 0.5rem; color: var(--text-muted); }
.cnt-io-state.on { color: var(--success); font-weight: 600; }
.timer-block, .counter-block { display: flex; flex-direction: column; width: 100%; }
/* Counter blokk - 3 línur */
.counter-block-3row { display: flex; flex-direction: column; width: 100%; font-family: 'JetBrains Mono', monospace; }
.counter-row-input { display: flex; align-items: center; height: 24px; border-bottom: 1px solid rgba(168,85,247,0.2); }
.counter-row-input:last-of-type { border-bottom: none; }
.counter-row-input .row-arrow { font-size: 0.8rem; color: var(--border); width: 20px; text-align: center; }
.counter-row-input.active .row-arrow { color: var(--success); }
.counter-row-input .row-label { font-size: 0.55rem; font-weight: 700; color: var(--purple); width: 14px; }
.counter-row-input.active .row-label { color: var(--success); }
.counter-row-input .row-content { flex: 1; display: flex; justify-content: space-between; align-items: center; padding: 0 0.2rem; font-size: 0.8rem; }
.counter-row-input .row-content .counter-type { font-weight: 700; color: var(--purple); }
.counter-row-input .row-content .counter-name { color: var(--text-muted); }
.counter-row-input .row-content .counter-label { color: var(--text-muted); }
.counter-row-input .row-content .counter-value { color: var(--purple); font-weight: 600; }
.counter-row-input .row-content .counter-value.active { color: var(--success); }
.counter-row-input .row-output { font-size: 0.8rem; color: var(--border); width: 35px; text-align: right; padding-right: 2px; }
.counter-row-input .row-output.active { color: var(--success); }
.counter-bar-row { padding: 0.15rem 0.25rem; }
.counter-bar-row .counter-bar { height: 4px; margin: 0; }
.timer-header, .counter-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--cyan); padding-bottom: 0.05rem; margin-bottom: 0.05rem; }
.counter-header { border-bottom-color: var(--purple); }
.timer-type, .counter-type { font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; font-weight: 600; color: var(--cyan); }
.timer-name, .counter-name { font-family: 'JetBrains Mono', monospace; font-size: 0.65rem; color: var(--text-primary); font-weight: 700; }
.timer-row, .counter-row { display: flex; justify-content: space-between; align-items: center; font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; }
.timer-label, .counter-label { color: var(--text-muted); }
.timer-value, .counter-value { color: var(--cyan); font-weight: 600; }
.timer-value.active, .counter-value.active { color: var(--success); }
.timer-bar, .counter-bar { height: 2px; background: var(--border); border-radius: 1px; margin-top: 0.05rem; overflow: hidden; }
.timer-bar-fill, .counter-bar-fill { height: 100%; background: var(--cyan); transition: width 0.1s linear; }
.counter-bar-fill { background: var(--purple); }
.timer-bar-fill.complete, .counter-bar-fill.complete { background: var(--success); }
/* Network með counter - parallel línur */
.network.has-counter .ladder-canvas { min-height: 160px; padding-top: 5px; }
.counter-branch { margin-top: -2px; }
.counter-branch-cells { gap: 0; position: relative; }
.counter-line-label { position: absolute; left: -18px; top: 50%; transform: translateY(-50%); font-size: 0.55rem; color: var(--purple); font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.counter-line-cell { width: 92px; }
.counter-line-cell.cursor { background: rgba(168,85,247,0.15); border-radius: 3px; outline: 1px dashed rgba(168,85,247,0.4); outline-offset: -1px; }
.counter-conn-cell { width: 60px; display: flex; align-items: center; justify-content: center; }
.counter-conn-label { font-size: 0.7rem; color: var(--purple); font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.counter-line-label-inline { display: none; }
/* Analog Compare */
.cell-component.compare { padding: 0.1rem; min-width: 0; max-width: 88px; width: 88px; align-self: flex-start; box-sizing: border-box; }
.cell-component.compare .component-symbol { color: #f97316; }
.compare-block { display: flex; flex-direction: column; width: 100%; font-family: 'JetBrains Mono', monospace; }
.compare-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f97316; padding-bottom: 0.1rem; margin-bottom: 0.1rem; }
.compare-type { font-size: 0.6rem; font-weight: 600; color: #f97316; }
.compare-name { font-size: 0.65rem; color: var(--text-primary); font-weight: 700; }
.compare-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.6rem; }
.compare-label { color: var(--text-muted); }
.compare-value { color: #f97316; font-weight: 600; }
.compare-value.active { color: var(--success); }
.compare-op { color: #f97316; font-weight: 700; font-size: 0.6rem; text-align: center; padding: 0.05rem 0; }
.compare-bar { height: 3px; background: var(--border); border-radius: 1px; margin-top: 0.1rem; overflow: hidden; }
.compare-bar-fill { height: 100%; background: #f97316; transition: width 0.1s linear; }
.compare-bar-fill.active { background: var(--success); }
/* Analog sliders */
.analog-group { display: flex; gap: 0.3rem; align-items: center; }
.analog-slider-wrapper { display: flex; flex-direction: column; align-items: center; gap: 0; }
.analog-slider-wrapper { display: flex; flex-direction: column; align-items: center; gap: 0; cursor: pointer; padding: 1px; border-radius: 3px; border: 1px solid transparent; }
.analog-slider-wrapper.selected { border-color: #f97316; background: rgba(249,115,22,0.1); }
.analog-label { font-size: 0.45rem; color: #f97316; font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.analog-slider { -webkit-appearance: none; appearance: none; width: 50px; height: 10px; border-radius: 3px; background: var(--bg-cell); border: 1px solid #f97316; outline: none; cursor: pointer; }
.analog-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 10px; height: 14px; border-radius: 2px; background: #f97316; cursor: pointer; }
.analog-slider::-moz-range-thumb { width: 10px; height: 14px; border-radius: 2px; background: #f97316; cursor: pointer; border: none; }
.analog-val { font-size: 0.75rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; min-width: 22px; text-align: center; }
.help-panel { background: var(--bg-card); border-top: 1px solid var(--border); padding: 0.3rem 0.6rem; font-size: 0.75rem; color: var(--text-secondary); }
.help-panel kbd { background: var(--border); padding: 0.05rem 0.15rem; border-radius: 2px; font-size: 0.55rem; }
.help-items { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.delete-zone { position: fixed; bottom: 45px; right: 320px; width: 45px; height: 45px; background: var(--error); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; opacity: 0; transform: scale(0.5); transition: all 0.3s; pointer-events: none; z-index: 100; }
.delete-zone.visible { opacity: 1; transform: scale(1); pointer-events: auto; }
.running-indicator { display: none; align-items: center; gap: 0.25rem; padding: 0.25rem 0.5rem; background: var(--success); color: white; border-radius: 4px; animation: pulse 1s infinite; font-size: 0.7rem; }
.running-indicator.active { display: flex; }
/* Simulation Sidebar - split: props efst, hermir neðst */
.sim-sidebar { grid-column: 3; grid-row: 2; width: 300px; background: var(--bg-card); border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
/* Props section efst - stækkar eftir þörfum */
.props-section { border-bottom: 2px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; }
.props-section-header { padding: 0.3rem 0.5rem; font-size: 0.7rem; font-weight: 600; background: var(--bg-cell); border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.props-section-body { overflow-y: auto; }
/* Sim section neðst - tekur rest af plássi */
.sim-section { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.sim-section-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.5rem; font-size: 0.7rem; font-weight: 600; background: var(--bg-cell); border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.sim-select { margin-left: auto; background: var(--bg-dark); border: 1px solid var(--border); color: var(--text-primary); font-family: inherit; font-size: 0.72rem; padding: 0.2rem 0.4rem; border-radius: 4px; cursor: pointer; outline: none; }
.sim-select:focus { border-color: var(--primary); }
.sim-content { flex: 1; overflow-y: auto; }
.sim-panel { display: none; padding: 0.5rem; }
.sim-panel.active { display: block; }
.task-info { background: var(--bg-cell); border-radius: 5px; padding: 0.4rem; margin-bottom: 0.4rem; }
.task-info-toggle { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; }
.task-info-toggle .toggle-arrow { font-size: 0.6rem; color: var(--text-muted); transition: transform 0.2s; }
.task-info.collapsed .task-io { display: none !important; }
.task-info.collapsed p { display: none; }
.task-info.collapsed .task-info-toggle .toggle-arrow { transform: rotate(-90deg); }
.task-info h4 { font-size: 0.8rem; color: #ff6b35; margin-bottom: 0.2rem; }
.task-info p { font-size: 0.55rem; color: var(--text-secondary); line-height: 1.3; }
.task-io { margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px solid var(--border); }
.task-io-item { font-size: 0.8rem; font-family: 'JetBrains Mono', monospace; padding: 0.08rem 0; display: flex; align-items: center; gap: 0.2rem; }
.io-label { min-width: 18px; padding: 0.05rem 0.1rem; border-radius: 2px; text-align: center; font-size: 0.45rem; }
.io-label.input { background: var(--primary); color: white; }
.io-label.output { background: var(--success); color: white; }
.sim-canvas { background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%); border-radius: 6px; position: relative; height: 200px; overflow: hidden; border: 1px solid var(--border); }
.conveyor { position: absolute; bottom: 30px; left: 15px; right: 15px; height: 20px; background: #2d2d2d; border-radius: 3px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,0.3); }
.conveyor-belt { position: absolute; top: 0; left: 0; width: 200%; height: 100%; background: repeating-linear-gradient(90deg, #3d3d3d 0px, #3d3d3d 15px, #4a4a4a 15px, #4a4a4a 30px); }
.conveyor-belt.running { animation: beltMove 0.5s linear infinite; }
.conveyor-belt.reverse { animation: beltMoveReverse 0.5s linear infinite; }
.conveyor-leg { position: absolute; bottom: -15px; width: 8px; height: 15px; background: #555; }
.conveyor-leg.left { left: 10px; }
.conveyor-leg.right { right: 10px; }
.box { position: absolute; bottom: 52px; width: 30px; height: 30px; background: linear-gradient(135deg, #d4a017 0%, #aa8414 100%); border: 2px solid #c9a227; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; box-shadow: 2px 2px 4px rgba(0,0,0,0.3); transition: left 0.05s linear; }
.sensor { position: absolute; bottom: 55px; display: flex; flex-direction: column; align-items: center; }
.sensor-post { width: 6px; height: 40px; background: linear-gradient(180deg, #666 0%, #444 100%); border-radius: 2px; }
.sensor-head { width: 12px; height: 12px; background: #333; border-radius: 50%; border: 2px solid #555; margin-bottom: 2px; transition: all 0.1s; }
.sensor-head.active { background: var(--error); border-color: var(--error); box-shadow: 0 0 10px var(--error); }
.sensor-beam { position: absolute; top: 14px; width: 2px; height: 32px; background: rgba(255,0,0,0.2); }
.sensor-beam.active { background: rgba(255,0,0,0.8); box-shadow: 0 0 5px red; }
.sensor-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
/* Conveyor buttons & turn lights */
.conv-buttons { position: absolute; top: 6px; left: 6px; display: flex; gap: 6px; z-index: 5; }
.conv-start-btn, .conv-stop-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; cursor: pointer; }
.conv-btn-circle { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #555; transition: all 0.15s; }
.conv-btn-circle.green { background: #1a3a1a; }
.conv-btn-circle.red { background: #3a1a1a; }
.conv-start-btn.active .conv-btn-circle.green { background: var(--success); box-shadow: 0 0 10px var(--success); border-color: var(--success); }
.conv-stop-btn.active .conv-btn-circle.red { background: var(--error); box-shadow: 0 0 10px var(--error); border-color: var(--error); }
.conv-start-btn span, .conv-stop-btn span { font-size: 0.75rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.conv-motor-under { position: absolute; bottom: 10px; left: 15px; right: 15px; display: flex; justify-content: space-between; }
.conv-turn-lights { position: absolute; top: 6px; right: 8px; display: flex; flex-direction: column; gap: 3px; z-index: 5; background: #222; padding: 4px; border-radius: 6px; border: 2px solid #444; }
.conv-turn-light { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #333; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.conv-turn-light span { font-size: 0.75rem; font-family: 'JetBrains Mono', monospace; color: rgba(255,255,255,0.3); font-weight: 700; }
.conv-turn-light.active-r { background: var(--error) !important; box-shadow: 0 0 12px var(--error); }
.conv-turn-light.active-y { background: var(--warning) !important; box-shadow: 0 0 12px var(--warning); }
.conv-turn-light.active-g { background: var(--success) !important; box-shadow: 0 0 12px var(--success); }
.conv-turn-light.active-r span, .conv-turn-light.active-y span, .conv-turn-light.active-g span { color: white; }
.status-panel { display: flex; gap: 0.3rem; }
.status-item { padding: 0.15rem 0.3rem; background: var(--bg-cell); border-radius: 3px; font-size: 0.8rem; font-family: 'JetBrains Mono', monospace; border: 1px solid var(--border); }
.status-item.active { background: var(--success); border-color: var(--success); }
.status-item.reverse { background: var(--warning); border-color: var(--warning); color: #000; }
.lights-panel { position: absolute; top: 8px; right: 8px; display: flex; gap: 0.25rem; }
.light { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #333; }
.light.green { background: #1a3a1a; }
.light.green.active { background: var(--success); box-shadow: 0 0 12px var(--success); }
.light.red { background: #3a1a1a; }
.light.red.active { background: var(--error); box-shadow: 0 0 12px var(--error); }
.sim-controls { padding: 0.4rem; border-top: 1px solid var(--border); display: flex; gap: 0.25rem; }
.sim-btn { padding: 0.25rem 0.4rem; font-size: 0.75rem; border-radius: 3px; cursor: pointer; border: 1px solid var(--border); background: var(--bg-cell); color: var(--text-primary); }
.sim-btn:hover { border-color: var(--primary); }
.sim-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
/* === Parking / Bílastæðahús hermir === */
.parking-canvas { background: linear-gradient(180deg,#11131f 0%,#1a1d2e 60%,#15182a 100%); }
.park-road { position:absolute; bottom:0; left:0; right:0; height:52px; background:#26262e; border-top:2px solid #3a3a44; }
.park-road-line { position:absolute; top:24px; left:0; right:80px; height:3px; background:repeating-linear-gradient(90deg,#caa23a 0 14px,transparent 14px 28px); }
.park-car { position:absolute; bottom:10px; font-size:1.7rem; line-height:1; z-index:2; transition:left 0.06s linear; filter:drop-shadow(0 2px 2px rgba(0,0,0,0.4)); transform:scaleX(-1); /* 🚗 vísar vinstri sjálfgefið - spegla svo hann vísi í akstursstefnu (hægri) */ }
.park-building { position:absolute; right:6px; bottom:52px; width:74px; height:96px; background:linear-gradient(180deg,#3a4066,#262a44); border:2px solid #4c5480; border-radius:5px 5px 0 0; display:flex; align-items:center; justify-content:center; z-index:1; }
.park-building span { font-size:2.4rem; font-weight:800; color:#aab2e0; font-family:'JetBrains Mono',monospace; }
.park-post { position:absolute; left:150px; bottom:52px; width:7px; height:46px; background:linear-gradient(#9aa0b0,#565b6b); border-radius:2px; z-index:3; }
.park-boom { position:absolute; left:86px; bottom:92px; width:66px; height:8px; border-radius:3px; background:repeating-linear-gradient(45deg,#e0353f 0 9px,#f5f5f5 9px 18px); transform-origin:right center; transition:transform 0.12s linear; z-index:3; box-shadow:0 1px 3px rgba(0,0,0,0.4); }
.park-signs { position:absolute; top:6px; right:8px; display:flex; gap:4px; z-index:4; }
.park-sign { padding:2px 6px; border-radius:3px; font-size:0.55rem; font-weight:700; font-family:'JetBrains Mono',monospace; border:1px solid #333; opacity:0.35; }
.park-sign.red { background:#5a2020; color:#ff8080; }
.park-sign.green { background:#1a5a2a; color:#90f0a0; }
.park-sign.red.on { opacity:1; background:var(--error); color:#fff; box-shadow:0 0 10px var(--error); }
.park-sign.green.on { opacity:1; background:var(--success); color:#fff; box-shadow:0 0 10px var(--success); }
.park-count { position:absolute; top:6px; left:8px; font-size:0.62rem; font-family:'JetBrains Mono',monospace; color:var(--text-secondary); background:rgba(0,0,0,0.3); padding:2px 6px; border-radius:3px; z-index:4; }
.park-count span { color:var(--cyan); font-weight:700; }
.park-limits { position:absolute; top:28px; left:8px; display:flex; flex-direction:column; gap:2px; z-index:4; }
.park-limit { font-size:0.5rem; font-family:'JetBrains Mono',monospace; color:var(--text-muted); background:rgba(0,0,0,0.3); padding:1px 4px; border-radius:2px; border:1px solid transparent; }
.park-limit.on { color:#fff; background:var(--success); border-color:var(--success); box-shadow:0 0 6px var(--success); }
.parking-canvas.park-fault { animation: parkFaultBlink 0.4s steps(1) infinite; }
@keyframes parkFaultBlink { 50% { box-shadow: inset 0 0 0 3px var(--error); } }
/* === Pökkunarvél / Packing machine hermir === */
.pack-canvas { background: linear-gradient(180deg,#181a26 0%,#1c1f30 60%,#15182a 100%); }
.pack-belt-wrap { bottom: 24px; }
.pack-funnel { position:absolute; top:30px; left:90px; width:62px; height:34px; background:linear-gradient(180deg,#5a6480,#3a4056); clip-path:polygon(0 0,100% 0,64% 100%,36% 100%); display:flex; justify-content:center; overflow:hidden; }
.pack-funnel-bolts { font-size:0.5rem; letter-spacing:-3px; padding-top:2px; opacity:0.9; white-space:nowrap; }
.pack-cylinder { position:absolute; top:62px; left:113px; width:16px; height:20px; background:linear-gradient(#9aa0b0,#5a5f70); border-radius:2px; z-index:3; }
.pack-cyl-rod { position:absolute; top:18px; left:50%; transform:translateX(-50%); width:5px; height:0; background:#cfd3dd; border-radius:0 0 2px 2px; transition:height 0.1s linear; }
.pack-box { position:absolute; bottom:44px; width:40px; height:30px; background:linear-gradient(180deg,#caa23a 0%,#a8801e 100%); border:2px solid #d8b24a; border-top:2px solid #8a6a18; border-radius:0 0 3px 3px; box-shadow:2px 2px 4px rgba(0,0,0,0.3); display:flex; flex-wrap:wrap; align-content:flex-end; justify-content:center; gap:1px; padding:2px; box-sizing:border-box; z-index:2; transition:left 0.05s linear; overflow:hidden; }
.pack-box-bolt { font-size:0.5rem; line-height:0.9; }
.pack-endstop { position:absolute; bottom:42px; left:226px; width:5px; height:34px; background:linear-gradient(#e0533f,#a8331f); border-radius:2px; z-index:1; }
.pack-selector { position:absolute; top:6px; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:3px; background:rgba(0,0,0,0.4); padding:2px 5px; border-radius:4px; z-index:4; }
.pack-sel-label { font-size:0.5rem; color:var(--text-muted); font-family:'JetBrains Mono',monospace; }
.pack-sel-btn { width:18px; height:18px; border:1px solid var(--border); background:var(--bg-cell); color:var(--text-secondary); border-radius:3px; font-size:0.6rem; font-family:'JetBrains Mono',monospace; cursor:pointer; padding:0; }
.pack-sel-btn.active { background:var(--cyan); border-color:var(--cyan); color:#10131f; font-weight:700; box-shadow:0 0 6px var(--cyan); }
.pack-count { position:absolute; bottom:6px; left:50%; transform:translateX(-50%); font-size:0.62rem; font-family:'JetBrains Mono',monospace; color:var(--text-secondary); background:rgba(0,0,0,0.4); padding:2px 8px; border-radius:3px; z-index:4; }
.pack-count span { color:var(--cyan); font-weight:700; }
/* === Kennsla / in-builder tutorial === */
.tut-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.tut-badge { font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; font-weight: 700; background: var(--primary); color: #fff; padding: 0.15rem 0.45rem; border-radius: 20px; white-space: nowrap; }
.tut-title { font-size: 0.95rem; color: var(--text-primary); margin: 0; }
.tut-goal { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 0.6rem; }
.tut-status { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; padding: 0.5rem 0.6rem; border-radius: 6px; background: var(--bg-cell); border: 1px solid var(--border); margin-bottom: 0.6rem; color: var(--text-secondary); }
.tut-status.ok { background: rgba(34,197,94,0.12); border-color: var(--success); color: var(--success); font-weight: 600; }
#tut-status-icon { font-size: 1rem; }
.tut-hints { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.5rem; }
.tut-hint { font-size: 0.75rem; color: var(--text-secondary); background: var(--bg-cell); border-left: 3px solid var(--cyan); border-radius: 4px; padding: 0.35rem 0.5rem; line-height: 1.4; }
.tut-actions, .tut-nav { display: flex; gap: 0.3rem; margin-bottom: 0.4rem; }
.tut-actions .sim-btn, .tut-nav .sim-btn { flex: 1; }
#tut-next-btn:disabled, #tut-prev-btn:disabled { opacity: 0.4; cursor: not-allowed; }
/* Properties Panel */
.prop-empty { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.75rem; }
.prop-empty-icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.4; }
.prop-card { background: var(--bg-cell); border-radius: 6px; margin: 0.4rem; overflow: hidden; }
.prop-card-header { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); }
.prop-card-icon { font-size: 1rem; }
.prop-card-title { font-size: 0.75rem; font-weight: 600; }
.prop-card-subtitle { font-size: 0.55rem; color: var(--text-muted); margin-left: auto; font-family: 'JetBrains Mono', monospace; }
.prop-section { padding: 0.4rem 0.5rem; }
.prop-section + .prop-section { border-top: 1px solid var(--border); }
.prop-section-title { font-size: 0.55rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.3rem; font-weight: 600; }
.prop-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.3rem; }
.prop-label { font-size: 0.7rem; color: var(--text-secondary); }
.prop-value { font-size: 0.7rem; font-family: 'JetBrains Mono', monospace; color: var(--text-primary); font-weight: 600; }
.prop-select, .prop-input { background: var(--bg-dark); border: 1px solid var(--border); color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; padding: 0.2rem 0.3rem; border-radius: 4px; outline: none; }
.prop-select:focus, .prop-input:focus { border-color: var(--primary); }
.prop-select { cursor: pointer; min-width: 70px; }
.prop-input { width: 70px; text-align: right; }
.prop-slider-row { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.3rem; }
.prop-slider { -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 3px; background: var(--border); outline: none; }
.prop-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); cursor: pointer; }
.prop-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--primary); cursor: pointer; border: none; }
.prop-slider.orange::-webkit-slider-thumb { background: #f97316; }
.prop-slider.orange::-moz-range-thumb { background: #f97316; }
.prop-slider.cyan::-webkit-slider-thumb { background: var(--cyan); }
.prop-slider.cyan::-moz-range-thumb { background: var(--cyan); }
.prop-slider.purple::-webkit-slider-thumb { background: var(--purple); }
.prop-slider.purple::-moz-range-thumb { background: var(--purple); }
.prop-status { display: flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.5rem; font-size: 0.8rem; }
.prop-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.prop-status-dot.active { background: var(--success); box-shadow: 0 0 6px var(--success); }
.prop-status-label { color: var(--text-muted); }
.prop-btn-row { display: flex; gap: 0.3rem; padding: 0.3rem 0.5rem; }
.prop-btn { flex: 1; padding: 0.3rem; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-dark); color: var(--text-secondary); font-size: 0.8rem; cursor: pointer; text-align: center; }
.prop-btn:hover { border-color: var(--primary); color: var(--text-primary); }
.prop-btn.danger:hover { border-color: var(--error); color: var(--error); }
/* Analog props */
.prop-analog-big { padding: 0.5rem; }
.prop-analog-big .prop-slider { height: 10px; border-radius: 5px; margin: 0.4rem 0; }
.prop-analog-big .prop-slider::-webkit-slider-thumb { width: 20px; height: 20px; background: #f97316; }
.prop-analog-big .prop-slider::-moz-range-thumb { width: 20px; height: 20px; background: #f97316; }
.prop-volt-display { display: flex; align-items: center; justify-content: center; gap: 0.3rem; padding: 0.4rem; background: var(--bg-dark); border-radius: 6px; border: 1px solid #f97316; margin: 0.3rem 0; }
.prop-volt-value { font-family: 'JetBrains Mono', monospace; font-size: 1.4rem; font-weight: 700; color: #f97316; }
.prop-volt-unit { font-size: 0.75rem; color: var(--text-muted); }
.prop-volt-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 0.3rem 0; }
.prop-volt-bar-fill { height: 100%; background: linear-gradient(90deg, #22c55e 0%, #eab308 50%, #ef4444 100%); border-radius: 4px; transition: width 0.1s; }
.prop-analog-item { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); }
.prop-analog-item:last-of-type { border-bottom: none; }
.prop-analog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.15rem; }
.prop-analog-name { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 700; color: #f97316; }
.prop-analog-volt { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; font-weight: 700; color: #f97316; }
.flag-icon { width: 20px; height: 14px; border-radius: 2px; vertical-align: middle; }
/* Tank simulation */
.sim-canvas.tank-tall { height: 240px; }
.tank-container { position: relative; width: 100%; height: 100%; padding: 4px; }
.tank-body { width: 100px; height: 180px; border: 3px solid #64748b; border-top: 2px solid #64748b; border-radius: 0 0 8px 8px; position: absolute; left: 50%; top: 10px; transform: translateX(-50%); overflow: hidden; background: #0a1628; }
.tank-water { position: absolute; bottom: 0; left: 0; right: 0; height: 0%; background: linear-gradient(180deg, rgba(59,130,246,0.6) 0%, rgba(37,99,235,0.9) 100%); transition: height 0.15s linear; }
.tank-water.filling { animation: tankWave 1s ease-in-out infinite; }
.tank-level-marks { position: absolute; top: 0; right: 2px; bottom: 0; display: flex; flex-direction: column; justify-content: flex-end; z-index: 2; }
.tank-mark { position: absolute; right: 0; display: flex; align-items: center; gap: 2px; }
.tank-mark::before { content: ''; width: 6px; height: 1px; background: rgba(255,255,255,0.3); }
.tank-mark span { font-size: 0.55rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.tank-level-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-family: 'JetBrains Mono', monospace; font-size: 1.2rem; font-weight: 700; color: white; z-index: 3; text-shadow: 0 0 8px rgba(0,0,0,0.8); }
.tank-pump { position: absolute; bottom: 8px; display: flex; flex-direction: column; align-items: center; z-index: 4; }
.tank-pump-body { width: 30px; height: 30px; background: var(--bg-cell); border: 2px solid #556; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.tank-pump-impeller { width: 16px; height: 16px; border: 2px solid #556; border-radius: 50%; position: relative; }
.tank-pump-impeller::before, .tank-pump-impeller::after { content: ''; position: absolute; background: #556; }
.tank-pump-impeller::before { width: 2px; height: 100%; left: 50%; transform: translateX(-50%); }
.tank-pump-impeller::after { width: 100%; height: 2px; top: 50%; transform: translateY(-50%); }
.tank-pump.active .tank-pump-body { border-color: var(--success); background: rgba(34,197,94,0.08); }
.tank-pump.active .tank-pump-impeller { border-color: var(--success); animation: pumpSpin 0.4s linear infinite; }
.tank-pump.active .tank-pump-impeller::before, .tank-pump.active .tank-pump-impeller::after { background: var(--success); }
.tank-pump-label { font-size: 0.75rem; color: var(--text-muted); text-align: center; line-height: 1.1; margin-top: 2px; }
.tank-pump.active .tank-pump-label { color: var(--success); }
.tank-pipe-up { position: absolute; width: 4px; background: #475569; border-radius: 1px; }
.tank-pipe-up.active { background: var(--primary); box-shadow: 0 0 5px var(--primary); animation: pipeFlow 0.4s linear infinite; }
.tank-pipe-elbow { position: absolute; width: 10px; height: 10px; border-top: 4px solid #475569; border-right: 4px solid #475569; border-radius: 0 6px 0 0; }
.tank-pipe-elbow.active { border-color: var(--primary); box-shadow: 0 0 3px var(--primary); }
.tank-pipe-horiz { position: absolute; height: 4px; background: #475569; border-radius: 1px; }
.tank-pipe-horiz.active { background: var(--primary); box-shadow: 0 0 5px var(--primary); animation: pipeFlow 0.4s linear infinite; }
.tank-drain { position: absolute; bottom: 8px; display: flex; flex-direction: column; align-items: center; z-index: 4; }
.tank-drain-body { width: 24px; height: 24px; background: var(--bg-cell); border: 2px solid #556; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.tank-drain.active .tank-drain-body { border-color: var(--warning); background: rgba(234,179,8,0.08); }
.tank-drain-arrow { font-size: 0.7rem; color: #556; }
.tank-drain.active .tank-drain-arrow { color: var(--warning); }
.tank-drain-label { font-size: 0.75rem; color: var(--text-muted); text-align: center; line-height: 1.1; margin-top: 2px; }
.tank-drain.active .tank-drain-label { color: var(--warning); }
.tank-pipe-down { position: absolute; width: 4px; background: #475569; border-radius: 1px; }
.tank-pipe-down.active { background: var(--warning); box-shadow: 0 0 5px var(--warning); animation: pipeFlow 0.4s linear infinite; }
.tank-lights { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; }
.tank-light { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #333; }
.tank-light.green { background: #1a3a1a; }
.tank-light.green.active { background: var(--success); box-shadow: 0 0 8px var(--success); }
.tank-light.red { background: #3a1a1a; }
.tank-light.red.active { background: var(--error); box-shadow: 0 0 8px var(--error); }
.tank-buttons { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; z-index: 5; }
.tank-io-btn { width: 36px; height: 36px; border: 2px solid var(--primary); border-radius: 6px; background: var(--bg-cell); color: var(--primary); font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; transition: all 0.1s; }
.tank-io-btn:hover { background: rgba(0,102,204,0.15); }
.tank-io-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 0 8px rgba(0,102,204,0.4); }
.tank-io-btn.stop { border-color: var(--error); color: var(--error); }
.tank-io-btn.stop:hover { background: rgba(239,68,68,0.15); }
.tank-io-btn.stop.active { background: var(--error); color: white; box-shadow: 0 0 8px rgba(239,68,68,0.4); }
.tank-io-sub { font-size: 0.55rem; font-weight: 400; opacity: 0.7; }
/* Tank switch box */
.tank-switch-box { position: absolute; top: 6px; left: 6px; background: #1a1a2e; border: 1.5px solid #444; border-radius: 5px; padding: 4px 5px; display: flex; flex-direction: column; align-items: center; gap: 3px; z-index: 5; }
.tank-switch-box-label { font-size: 0.55rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; text-transform: uppercase; }
.tank-push-btn { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #555; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.1s; }
.tank-push-btn.green { background: #1a5a2a; border-color: #22c55e; }
.tank-push-btn.red { background: #5a1a1a; border-color: #ef4444; }
.tank-push-btn.green.active { background: var(--success); box-shadow: 0 0 8px var(--success); border-color: var(--success); }
.tank-push-btn.red.active { background: var(--error); box-shadow: 0 0 8px var(--error); border-color: var(--error); }
.tank-push-btn span { font-size: 0.3rem; color: rgba(255,255,255,0.5); font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.tank-push-btn.active span { color: white; }
/* Potentiometer */
.tank-pot { position: absolute; top: 105px; right: 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 5; }
.tank-pot-label { font-size: 0.55rem; color: #f97316; font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.tank-pot-body { width: 44px; height: 44px; border-radius: 50%; background: #1a1a2e; border: 2px solid #f97316; position: relative; cursor: pointer; }
.tank-pot-track { position: absolute; top: 3px; left: 3px; right: 3px; bottom: 3px; border-radius: 50%; border: 2px dashed rgba(249,115,22,0.2); }
.tank-pot-needle { position: absolute; top: 50%; left: 50%; width: 2px; height: 18px; background: #f97316; transform-origin: 50% 0%; transform: rotate(60deg); border-radius: 1px; box-shadow: 0 0 4px rgba(249,115,22,0.5); }
.tank-pot-center { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; background: #f97316; border-radius: 50%; transform: translate(-50%,-50%); }
.tank-pot-value { font-size: 0.8rem; color: #f97316; font-family: 'JetBrains Mono', monospace; font-weight: 600; }
/* Setpoint lína á tanki */
.tank-setpoint-line { position: absolute; left: calc(50% + 10px - 50px); width: 100px; height: 0; border-top: 2px dashed #f97316; z-index: 2; pointer-events: none; transition: top 0.15s; display: none; }
.tank-setpoint-line.visible { display: block; }
.tank-setpoint-label { position: absolute; right: -22px; top: -7px; font-size: 0.75rem; color: #f97316; font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.tank-ia-display { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); background: var(--bg-cell); border: 1px solid #f97316; border-radius: 4px; padding: 2px 8px; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: #f97316; font-weight: 600; z-index: 5; }
.tank-sensor { position: absolute; left: -70px; display: flex; align-items: center; gap: 3px; z-index: 4; }
.tank-sensor-dot { width: 8px; height: 8px; border-radius: 50%; background: #1a2a3a; border: 1.5px solid #334; transition: all 0.15s; }
.tank-sensor.active .tank-sensor-dot { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 8px rgba(59,130,246,0.7); }
.tank-sensor-label { font-family: 'JetBrains Mono', monospace; font-size: 0.55rem; color: var(--text-muted); white-space: nowrap; }
.tank-sensor.active .tank-sensor-label { color: var(--primary); }
.tank-elbow-drain { }
.file-input { display: none; }
.btn-file { position: relative; overflow: hidden; }
/* === Krossgatnamót / Crossroads hermir (v1.4.1) ===
   Svið 260×240 px. Gata A liggur norður–suður (x 102–158), gata B vestur–austur (y 92–148).
   Bílar A aka norður á hægri akrein, bílar B aka austur á neðri akrein. */
.sim-canvas.xr-canvas { height: 240px; background: #1d2b22; }
[data-theme="light"] .sim-canvas.xr-canvas { background: #b9d3b0; }
.xr-stage { position: relative; width: 260px; height: 240px; margin: 0 auto; }
.xr-canvas.xr-crashed { animation: parkFaultBlink 0.4s steps(1) infinite; }
.xr-road { position: absolute; background: #34363d; }
.xr-road-a { left: 102px; top: 0; width: 56px; height: 240px; }
.xr-road-b { left: 0; top: 92px; width: 260px; height: 56px; }
.xr-lane-line { position: absolute; }
.xr-road-a .xr-lane-line { left: 27px; top: 0; bottom: 0; width: 2px; background: repeating-linear-gradient(180deg,#d8b13a 0 10px,transparent 10px 20px); }
.xr-road-b .xr-lane-line { top: 27px; left: 0; right: 0; height: 2px; background: repeating-linear-gradient(90deg,#d8b13a 0 10px,transparent 10px 20px); }
.xr-box { position: absolute; left: 102px; top: 92px; width: 56px; height: 56px; background: #34363d; z-index: 1; }
.xr-stopline { position: absolute; background: #f2f2f2; z-index: 1; }
.xr-stop-a { left: 130px; top: 150px; width: 28px; height: 3px; }
.xr-stop-b { left: 97px; top: 120px; width: 3px; height: 28px; }
.xr-loop { position: absolute; left: 60px; top: 122px; width: 34px; height: 24px; border: 1.5px dashed #6b7280; border-radius: 3px; z-index: 1; display: flex; align-items: flex-start; justify-content: flex-start; }
.xr-loop span { font-size: 0.45rem; font-family: 'JetBrains Mono', monospace; color: #9ca3af; padding: 0 2px; }
.xr-loop.on { border-color: var(--cyan); border-style: solid; box-shadow: 0 0 6px var(--cyan); }
.xr-loop.on span { color: var(--cyan); }
.xr-label { position: absolute; font: 700 0.6rem 'JetBrains Mono', monospace; color: rgba(255,255,255,0.45); z-index: 1; }
.xr-label-a { left: 140px; top: 222px; }
.xr-label-b { left: 4px; top: 128px; }
.xr-head { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 2px; background: #15161a; border: 1.5px solid #444; border-radius: 4px; padding: 3px 2px 2px; z-index: 4; }
.xr-head span { font: 700 0.45rem 'JetBrains Mono', monospace; color: #9ca3af; }
.xr-head-a { left: 164px; top: 152px; }
.xr-head-b { left: 74px; top: 152px; }
.xr-lamp { width: 10px; height: 10px; border-radius: 50%; transition: all 0.1s; }
.xr-lamp.r { background: #4a1c1c; } .xr-lamp.y { background: #4a421c; } .xr-lamp.g { background: #1c4a26; }
.xr-lamp.r.on { background: var(--error); box-shadow: 0 0 8px var(--error); }
.xr-lamp.y.on { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.xr-lamp.g.on { background: var(--success); box-shadow: 0 0 8px var(--success); }
.xr-car { position: absolute; border-radius: 4px; z-index: 3; box-shadow: 0 2px 3px rgba(0,0,0,0.45); }
.xr-car::before { content: ''; position: absolute; background: rgba(170,215,255,0.75); border-radius: 2px; }
.xr-car.dir-a { width: 16px; height: 26px; }
.xr-car.dir-a::before { left: 3px; right: 3px; top: 4px; height: 6px; }
.xr-car.dir-b { width: 26px; height: 16px; }
.xr-car.dir-b::before { top: 3px; bottom: 3px; right: 4px; width: 6px; }
.xr-switches { top: 6px; left: 6px; }
.xr-night { position: absolute; top: 6px; right: 6px; z-index: 5; font: 600 0.6rem 'JetBrains Mono', monospace; padding: 3px 6px; border-radius: 4px; border: 1.5px solid #555; background: #1a1a2e; color: var(--text-muted); cursor: pointer; }
.xr-night.on { background: #2a2a55; border-color: var(--purple); color: #fff; box-shadow: 0 0 6px var(--purple); }
.xr-count { position: absolute; left: 6px; bottom: 6px; z-index: 5; font: 0.6rem 'JetBrains Mono', monospace; color: #e5e7eb; background: rgba(0,0,0,0.4); padding: 2px 6px; border-radius: 3px; }
.xr-count span { color: var(--cyan); font-weight: 700; }
.xr-warn { position: absolute; right: 6px; bottom: 6px; z-index: 6; font: 700 0.55rem 'JetBrains Mono', monospace; color: #fff; background: var(--warning); padding: 2px 6px; border-radius: 3px; display: none; }
.xr-warn.on { display: block; }
.xr-crash { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 7; display: none; flex-direction: column; align-items: center; font: 800 0.95rem 'Plus Jakarta Sans', sans-serif; color: #fff; background: rgba(220,38,38,0.92); padding: 6px 12px; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,0.5); }
.xr-crash small { font-size: 0.55rem; font-weight: 600; opacity: 0.9; }
.xr-crash.on { display: flex; }
