* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #0b0b0d;
    color: #f5f5f7;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 860px;
    max-height: 100vh;
    padding: 20px;
    overflow-y: auto;
}

@media screen and (max-width: 768px) and (orientation: portrait) {
    body {
        transform: rotate(90deg);
        transform-origin: left top;
        width: 100vh;
        height: 100vw;
        position: absolute;
        top: 0;
        left: 100vw;
        overflow-y: auto;
    }
    .app-container {
        max-width: none;
        width: 100vh;
        height: 100vw;
        padding: 15px 30px;
    }
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

h1 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
    color: #f5f5f7;
}

.version-badge {
    font-size: 0.75rem;
    background: #2c2c2e;
    padding: 2px 6px;
    border-radius: 4px;
    color: #8e8e93;
    font-family: monospace;
}

.card {
    background: #161618;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #2c2c2e;
    box-shadow: 0 10px 28px rgba(0,0,0,0.6);
}

.row {
    display: flex;
    gap: 14px;
    align-items: center;
}

.col {
    flex: 1;
}

button {
    background-color: #0071e3;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover { background-color: #0077ed; }
button:active { transform: scale(0.98); }
button:disabled { background-color: #2c2c2e; color: #545458; cursor: not-allowed; }

#recordBtn.recording { background-color: #ff3b30; animation: pulse 1.5s infinite; }
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.secondary-btn { background-color: #2c2c2e; color: #f5f5f7; }

.status {
    font-size: 0.8rem;
    color: #8e8e93;
    margin-bottom: 4px;
}

.canvas-label {
    font-size: 0.75rem;
    color: #8e8e93;
    margin-bottom: 4px;
    font-family: monospace;
    display: flex;
    justify-content: space-between;
}

.canvas-wrapper {
    position: relative;
    background-color: #0b0b0d;
    border-radius: 8px;
    border: 1px solid #2c2c2e;
    margin-bottom: 10px;
    overflow: hidden;
    width: 100%;
}

canvas {
    display: block;
    touch-action: none;
    width: 100%;
}
#overviewCanvas { height: 75px; cursor: pointer; }
#zoomCanvas { height: 145px; cursor: crosshair; }

.meter-group {
    margin-top: 6px;
}
.meter-label {
    font-size: 0.65rem;
    color: #8e8e93;
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
    font-family: monospace;
}
.level-container {
    width: 100%;
    height: 4px;
    background-color: #2c2c2e;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 2px;
}
.level-fill {
    width: 0%;
    height: 100%;
    background-color: #34c759;
    transition: width 0.05s ease;
}

.controls-toolbar {
    display: flex;
    gap: 10px;
    margin: 12px 0;
    align-items: center;
}

.settings-group {
    margin-top: 10px;
    font-size: 0.8rem;
}
.settings-group label {
    display: block;
    color: #aeaeb2;
    margin-bottom: 2px;
}
.settings-group input[type="text"] {
    width: 100%;
    padding: 8px;
    background-color: #2c2c2e;
    border: 1px solid #3a3a3c;
    color: #f5f5f7;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.trim-button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.drop-zone-active {
    border: 2px dashed #0071e3 !important;
}
