#polar-il-lab {
    width: 800px;
    max-width: 800px;
    box-sizing: border-box;
    background: #05090f;
    color: #d7ebff;
    font-family: "Courier New", monospace;
    border: 1px solid #26364d;
    padding: 10px;
}

#polar-il-lab * {
    box-sizing: border-box;
    font-family: "Courier New", monospace;
}

.pil-example-step {
    width: 800px;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #26364d;
    background: #f7fbff;
    padding: 8px 10px;
    margin: 8px 0;
}

.pil-example-step p {
    margin: 4px 0;
}

#polar-il-lab button,
#polar-il-lab select,
#polar-il-lab input {
    background: #101a28;
    color: #ffffff;
    border: 1px solid #36506f;
    padding: 4px 8px;
    font-weight: bold;
}

#polar-il-lab button {
    cursor: pointer;
}

#polar-il-lab button:hover,
#polar-il-lab select:hover,
#polar-il-lab input:hover {
    border-color: #ffd166;
}

.pil-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 12px;
    border: 1px solid #26364d;
    padding: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.pil-control-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    min-width: 0;
}

.pil-control-row.pil-wide {
    grid-column: 1 / span 2;
    grid-template-columns: 110px minmax(0, 1fr) 42px;
}

.pil-control-row.pil-animation-row {
    grid-column: 1 / span 2;
    grid-template-columns: 110px 120px 120px 90px 90px;
    justify-content: start;
}

.pil-animation-row button {
    min-width: 88px;
}

.pil-value {
    color: #ffd166;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}

.pil-bit-hint {
    text-align: center;
}

.pil-tabs {
    display: flex;
    gap: 6px;
    margin: 8px 0 10px;
}

.pil-tab {
    border: 1px solid #26364d;
    padding: 7px 10px;
    color: #8fc7ff;
    background: #09111d;
}

.pil-tab.active {
    background: #ffd166;
    color: #000000;
    border-color: #ffd166;
}

.pil-stage-note {
    border: 1px solid #26364d;
    background: #07101a;
    padding: 10px;
    margin-bottom: 10px;
    line-height: 1.45;
}

.pil-grid {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 10px;
    align-items: start;
}

.pil-vertical-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
}

.pil-column-stack {
    display: grid;
    gap: 10px;
    align-items: start;
}

.pil-panel {
    border: 1px solid #26364d;
    background: #07101a;
    padding: 10px;
    min-width: 0;
    width: 100%;
}

.pil-panel h3 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #9bd3ff;
}

.pil-bit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    min-height: 38px;
    padding: 6px;
    background: #04080e;
    border: 1px solid #1f3046;
    margin-bottom: 8px;
}

.pil-bit {
    width: 32px;
    min-height: 30px;
    border: 1px solid #36506f;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #101a28;
    color: #ffffff;
}

.pil-bit .idx {
    font-size: 9px;
    color: #8fc7ff;
}

.pil-bit .val {
    font-size: 14px;
    font-weight: bold;
}

.pil-bit.active-source {
    border-color: #ff6b8a;
    background: #4b1425;
}

.pil-bit.active-target {
    border-color: #ffd166;
    background: #4b3b05;
}

.pil-bit.muted {
    opacity: 0.35;
}

.pil-equation {
    border: 1px solid #36506f;
    background: #02060b;
    padding: 9px;
    margin-bottom: 8px;
    line-height: 1.55;
    font-size: 12px;
}

.pil-highlight {
    color: #ffd166;
}

.pil-ok {
    color: #66f2a5;
}

.pil-warn {
    color: #ff8aa0;
}

.pil-canvas-wrap {
    position: relative;
    border: 1px solid #26364d;
    background: #02060b;
}

#pilCanvas {
    display: block;
    width: 100%;
    height: 220px;
}

.pil-table-wrap {
    max-height: 310px;
    overflow: auto;
    border: 1px solid #26364d;
    background: #02060b;
    scrollbar-color: #6f88a8 #07101a;
    scrollbar-width: thin;
}

.pil-table-wrap::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.pil-table-wrap::-webkit-scrollbar-track {
    background: #07101a;
    border-left: 1px solid #26364d;
}

.pil-table-wrap::-webkit-scrollbar-thumb {
    background: #36506f;
    border: 2px solid #07101a;
}

.pil-table-wrap::-webkit-scrollbar-thumb:hover {
    background: #ffd166;
}

.pil-table-wrap::-webkit-scrollbar-corner {
    background: #07101a;
}

.pil-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px;
}

.pil-table th,
.pil-table td {
    border: 1px solid #26364d;
    padding: 4px 5px;
    text-align: right;
    color: #d7ebff;
}

.pil-table th {
    position: sticky;
    top: 0;
    background: #101a28;
    color: #9bd3ff;
    z-index: 1;
}

.pil-table tr.selected td {
    background: #4b3b05;
    color: #ffffff;
}

.pil-table td.used {
    color: #ffd166;
    font-weight: bold;
}

.pil-table td.skip {
    color: #8da5bf;
}

.pil-summary-list {
    display: grid;
    gap: 6px;
}

.pil-summary-item {
    border: 1px solid #26364d;
    background: #02060b;
    padding: 7px;
    line-height: 1.45;
}

.pil-mini {
    font-size: 12px;
    color: #a9c7e8;
}

.pil-footer-note {
    margin-top: 6px;
    color: #a9c7e8;
    line-height: 1.3;
}
