:root {
    --primary: #FF0000;
    --secondary: #FFFFFF;
    --background: #1B1B1C;
    --surface: #1B1B1C;
    --error: #B00020;
    --on-primary: #FFFFFF;
    --on-secondary: #000000;
    --on-background: #FFFFFF;
    --on-surface: #FFFFFF;
    --on-error: #FFFFFF;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { -webkit-tap-highlight-color: transparent; }

html, body, main, .card, .pair-grid, .actions-row {
    touch-action: pan-x pan-y !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--on-background);
    line-height: 1.6;
    padding: 16px;
    max-width: 100%;
    overflow-x: hidden;
}

input, select, textarea, button { font-size: 16px; }

.top-strip {
    height: 44px;
    width: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.top-strip img {
    height: 80%;
    width: auto;
    max-height: 80%;
    display: block;
    pointer-events: none;
}

.card {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #333;
}

.input-group { margin-bottom: 0; }

label {
    display: block;
    font-size: 14px;
    color: var(--on-surface);
    margin-bottom: 6px;
    font-weight: 500;
}

.time-input {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #2A2A2B;
    color: var(--on-surface);
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

.time-input:focus { outline: none; border-color: var(--primary); }

.button {
    background: var(--primary);
    color: var(--on-primary);
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}
.button:hover {
    background: var(--secondary);
    color: var(--primary);
}
.button.secondary { background: var(--secondary); color: var(--on-secondary); }
.button.danger { background: var(--error); color: var(--on-error); }

.actions-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}
.actions-row .button.small {
    flex: 1 1 0;
    width: auto;
    padding: 10px 12px;
}

.break-row {
    background: #2A2A2B;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.break-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.break-title { font-size: 14px; font-weight: 500; color: var(--on-surface); }

/* Stats panel */
.stats-panel { padding: 12px 16px; }
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}
.stat-item:last-child { border-bottom: 0; }
.stat-label { color: var(--on-surface); font-size: 14px; }
.stat-value { font-weight: 600; font-size: 16px; color: var(--secondary); }
.delta-positive { color: #4CAF50; }
.delta-negative { color: var(--error); }

/* Inputs paired in two columns */
.pair-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 16px;
    row-gap: 12px;
}

@media (min-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* Time grids inside breaks */
.time-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 480px) {
    .time-grid { grid-template-columns: 1fr 1fr; }
}

.footer-buttons { display: flex; gap: 12px; margin-top: 16px; }
.footer-buttons .button { flex: 1; }
