/* LinxPos Device Emulator - its view, scoped to .emu (shared by tools/emulator and the portal) */
.emu { --bg: #f3f4f7; --card: #fff; --ink: #1c2230; --muted: #6b7385; --line: #d9dde6; --accent: #3f6fd8; --ok: #2e9d57; --warn: #d9822b; --bad: #c73a3a; }
@media (prefers-color-scheme: dark) {
    .emu { --bg: #151a24; --card: #1f2533; --ink: #e6e9f0; --muted: #98a0b3; --line: #343c4f; }
}
.emu, .emu * { box-sizing: border-box; }
.emu { margin: 0; font: 14px/1.4 system-ui, sans-serif; background: var(--bg); color: var(--ink); }
.emu button { font: inherit; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); cursor: pointer; }
.emu button:hover { border-color: var(--accent); }
.emu button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.emu button.linkish { border: none; background: none; color: var(--accent); margin-left: auto; padding: 0; }
.emu input, .emu select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
.emu input[type=checkbox] { padding: 0; }
.emu .muted { color: var(--muted); }
.emu .small { font-size: 12px; }
.emu .warn { color: var(--warn); }
.emu header.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.emu header.top h1 { font-size: 18px; margin: 0; }
.emu .tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.emu .tab.selected { border-color: var(--accent); background: var(--accent); color: #fff; }
.emu .log-toggle { margin-left: auto; }
.emu .status { margin: 8px 16px; color: var(--muted); }
.emu main { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 0 16px 16px; }
.emu main.with-log { grid-template-columns: 1fr 380px; }
@media (max-width: 1000px) {
    .emu main.with-log { grid-template-columns: 1fr; }
}
.emu .card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.emu .card.down { opacity: .75; }
.emu .card header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.emu .card h3 { margin: 0; font-size: 15px; }
.emu .card code { color: var(--muted); font-size: 12px; }
.emu .card .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.emu .faults { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 6px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.emu .fault.active { color: var(--bad); font-weight: 600; }
.emu .tag { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--line); }
.emu .tag.ok { background: var(--ok); color: #fff; }
.emu .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--muted); }
.emu .dot.on { background: var(--ok); }
.emu .dot.warn { background: var(--warn); }
.emu .dot.off { background: var(--bad); }
.emu .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.emu .row input:not([type=checkbox]) { flex: 1; min-width: 120px; }
.emu .chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.emu .chip { font-size: 13px; }
.emu .chip.light { color: var(--muted); }
.emu .chip.selected { background: var(--accent); color: #fff; }
.emu .coin { border-radius: 50%; width: 52px; height: 52px; padding: 0; background: #d9b24c; color: #222; border: none; }
.emu .note { width: 70px; height: 40px; background: #7fb08d; color: #111; border: none; }
.emu .paper { background: #fffdf6; color: #222; font-family: ui-monospace, monospace; font-size: 12px; height: 320px; overflow-y: auto; padding: 8px 10px; border-radius: 4px; box-shadow: inset 0 0 0 1px #e5e0cf; }
.emu .paper.empty { background: #f4efe0; }
.emu .pl { white-space: pre; min-height: 1.3em; }
.emu .pic { text-align: center; padding: 4px 0; }
.emu .pic img { image-rendering: pixelated; max-width: 100%; display: block; margin: 0 auto; }
.emu .qr-open { display: inline-block; margin-top: 6px; font: 600 12px system-ui, sans-serif; padding: 5px 12px; border-radius: 6px; background: #3F6FD8; color: #fff; text-decoration: none; }
.emu .qr-open:hover { background: #2F5BC0; }
.emu .pl .wide { letter-spacing: .6em; }
.emu .pl .tall { font-size: 1.5em; }
.emu .pl .bold { font-weight: 700; }
.emu .cut { color: #b0a890; text-align: center; margin: 6px 0; }
.emu .paper-out { color: var(--bad); font-weight: 700; text-align: center; padding: 8px; }
.emu .vfd { background: #0b1410; color: #57f08d; font-family: ui-monospace, monospace; font-size: 20px; padding: 10px 14px; border-radius: 6px; letter-spacing: .08em; }
.emu .vfd div { white-space: pre; min-height: 1.3em; }
.emu .lamp { width: 40px; height: 40px; border-radius: 50%; background: #444; box-shadow: inset 0 0 8px #000; }
.emu .lamp.green { background: #2ecc71; }
.emu .lamp.amber { background: #f5a623; }
.emu .lamp.red { background: #e74c3c; }
.emu .lamp.flashing { background: #f5a623; animation: blink 1s steps(2) infinite; }
.emu 50% { background: #444; }
.emu .drawer { height: 70px; perspective: 400px; }
.emu .drawer .front { height: 60px; border-radius: 6px; background: #5a6275; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; transition: transform .3s; }
.emu .drawer.open .front { background: var(--warn); transform: translateY(8px) scale(1.04); }
.emu .scale-read { font-family: ui-monospace, monospace; font-size: 26px; }
.emu .pending { border: 2px solid var(--accent); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.emu .pending .amount { font-size: 22px; font-weight: 700; }
.emu .history { font-size: 12px; border-collapse: collapse; }
.emu .history td { padding: 2px 6px; border-top: 1px solid var(--line); }
.emu .activity { margin: 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
.emu .log { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-family: ui-monospace, monospace; font-size: 11px; max-height: calc(100vh - 120px); overflow-y: auto; position: sticky; top: 8px; }
.emu .log-line { word-break: break-all; padding: 2px 0; border-bottom: 1px dotted var(--line); }
.emu #blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 8px 16px; background: #ffe7a6; color: #222; }
.emu #blazor-error-ui .dismiss { cursor: pointer; float: right; }
.emu .columns { display: grid; gap: 12px; align-items: stretch; overflow-x: auto; }
.emu .column { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 120px; border-radius: 12px; }
.emu .columns.dragging .column { outline: 1px dashed var(--line); outline-offset: 4px; }
.emu .column-end { min-height: 24px; flex: 1 0 24px; border-radius: 10px; color: var(--muted); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.emu .columns.dragging .column-end { min-height: 60px; border: 2px dashed var(--line); }
.emu .column-end.drop { border-color: var(--accent) !important; color: var(--accent); }
.emu .cols-ctl { margin-left: 8px; font-size: 12px; }
.emu .small-btn { padding: 0 7px; font-size: 12px; }
.emu .tile { border-radius: 12px; }
.emu .tile.drop { outline: 2px dashed var(--accent); outline-offset: 3px; }
.emu .card { display: flex; flex-direction: column; resize: vertical; min-height: 80px; }
.emu .card .body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.emu .card .body > .paper { flex: 1 0 auto; min-height: 120px; }
.emu .grip { cursor: grab; color: var(--muted); font-size: 16px; line-height: 1; user-select: none; padding: 0 2px; }
.emu .grip:active { cursor: grabbing; }
.emu button.linkish.inline { margin-left: 8px; font-size: 12px; }
.emu .cassettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.emu .cassette { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 6px; border: 1px solid var(--line); }
.emu .cassette.is-note { background: color-mix(in srgb, #7fb08d 25%, var(--card)); }
.emu .cassette.is-coin { background: color-mix(in srgb, #d9b24c 22%, var(--card)); }
.emu .cassette.empty { opacity: .55; }
.emu .cassette .denom { font-size: 12px; color: var(--muted); }
.emu .cassette .count { font-size: 18px; font-weight: 700; }
.emu .cassette .adj { display: flex; gap: 4px; }
.emu .cassette .adj button { padding: 0 8px; }
