* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 240px;
    height: 282px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #0b0e12;
    color: #f5f7fa;
    overflow: hidden;
}

button {
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.sensor-app {
    width: 100%;
    height: 100%;
    border: 5px solid #4dc3ff;
    display: flex;
    flex-direction: column;
    background: #10151b;
}

.sensor-header {
    height: 38px;
    padding: 4px 7px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #26313b;
    background: #151c24;
}

.sensor-header h1 {
    font-size: 13px;
    line-height: 1;
    margin-bottom: 2px;
}

.sensor-main {
    flex: 1;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    overflow-x: hidden;
}

.card {
    background: #161d25;
    border: 1px solid #2b3741;
    border-radius: 6px;
    padding: 4px 5px;
}

.compact-card {
    padding: 3px 5px;
}

.section-title {
    font-size: 9px;
    text-transform: uppercase;
    color: #8fb8d8;
    margin-bottom: 3px;
    letter-spacing: 0.3px;
}

.row-between {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.label {
    font-size: 8px;
    color: #8ea0b0;
    text-transform: uppercase;
}

.value {
    font-size: 9px;
    color: #f4f7fa;
    text-align: right;
}

.small-value {
    font-size: 8px;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mono {
    font-family: 'SFMono-Regular', Consolas, monospace;
}

.xyz-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.compact-xyz {
    gap: 3px;
}

.axis-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.bar {
    height: 8px;
    margin-top: 2px;
    background: #0f1419;
    border: 1px solid #2c3944;
    border-radius: 999px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 50%;
    transition: width 0.08s linear;
}

.x-bar { background: #ff7b72; }
.y-bar { background: #7ee787; }
.z-bar { background: #79c0ff; }

.payload-box {
    margin-top: 2px;
    background: #0d1217;
    border: 1px solid #26313b;
    border-radius: 4px;
    padding: 3px 4px;
    font-size: 8px;
    line-height: 1.25;
    max-height: 40px;
    overflow: hidden;
}

.small-payload {
    max-height: 30px;
}

.events-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
}

.compact-events {
    gap: 2px;
}

.event-pill {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 8px;
    background: #0e1419;
    border: 1px solid #26313b;
    border-radius: 999px;
    padding: 2px 5px;
}

.event-pill strong {
    color: #79c0ff;
}

.mode-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: bold;
}

.mode-badge.mock {
    background: #3a2a00;
    color: #ffd24d;
    border: 1px solid #8a6d00;
}

.mode-badge.live {
    background: #00331a;
    color: #6dffb3;
    border: 1px solid #00aa55;
}

.mini-button {
    padding: 5px 6px;
    background: #33414d;
    color: #fff;
    font-size: 9px;
    font-weight: 600;
}

.top-summary .row-between + .row-between {
    margin-top: 2px;
}

.accel-card .section-title,
.debug-summary {
    margin-bottom: 4px;
}

.debug-card summary {
    list-style: none;
    cursor: pointer;
}

.debug-card summary::-webkit-details-marker {
    display: none;
}

.debug-label {
    margin-top: 4px;
}

.mock-controls {
    min-height: 0;
}

.mock-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
