* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
font-family: 'Tajawal', system-ui, sans-serif;
background: #f5f5f7;
color: #1d1d1f;
min-height: 100vh;
display: flex;
flex-direction: column;
line-height: 1.5;
}
#app { display: flex; flex-direction: column; min-height: 100vh; max-width: 100%; }

.app-bar {
position: sticky;
top: 0;
z-index: 40;
background: rgba(255,255,255,0.9);
backdrop-filter: saturate(180%) blur(20px);
border-bottom: 1px solid rgba(0,0,0,0.06);
padding: 12px 16px;
text-align: center;
}
.app-bar h1 { font-size: 1.125rem; font-weight: 700; color: #1d1d1f; }

#screens { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: 100px; }
.screen { display: none; animation: fadeIn 0.2s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.counter-card {
background: #fff;
border-radius: 24px;
padding: 32px 24px;
box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
text-align: center;
margin-bottom: 16px;
}
.counter-header { margin-bottom: 16px; }
.counter-header time { font-size: 0.9375rem; color: #86868b; font-weight: 500; }
.counter-value { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 8px 0 24px; }
#step-count { font-size: 6rem; font-weight: 800; line-height: 1; color: #1d1d1f; font-variant-numeric: tabular-nums; font-family: 'Tajawal', system-ui, sans-serif; }
.counter-unit { font-size: 1.5rem; font-weight: 500; color: #86868b; margin-bottom: 4px; }

.btn-increment {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
width: 100%;
max-width: 280px;
padding: 18px 24px;
background: #007aff;
color: #fff;
border: none;
border-radius: 16px;
font: inherit;
font-size: 1.125rem;
font-weight: 700;
cursor: pointer;
touch-action: manipulation;
transition: background 0.15s, transform 0.08s, box-shadow 0.15s;
box-shadow: 0 4px 14px rgba(0,122,255,0.3), 0 2px 4px rgba(0,122,255,0.2);
min-height: 56px;
}
.btn-increment:active { transform: scale(0.97); background: #005ecb; }
.btn-increment:focus-visible { outline: 3px solid #007aff; outline-offset: 3px; }
.btn-increment svg { flex-shrink: 0; }

.counter-hint { margin-top: 16px; font-size: 0.875rem; color: #86868b; }

.quick-stats {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px;
}
.stat {
background: #fff;
border-radius: 16px;
padding: 16px 12px;
text-align: center;
box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.stat-value { display: block; font-size: 1.5rem; font-weight: 800; color: #1d1d1f; font-variant-numeric: tabular-nums; }
.stat-label { display: block; margin-top: 4px; font-size: 0.75rem; font-weight: 500; color: #86868b; text-transform: uppercase; letter-spacing: 0.3px; }

.history-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
padding: 0 4px;
}
.history-header h2 { font-size: 1.25rem; font-weight: 700; }
.btn-reset {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 10px 14px;
background: #fff;
border: 1px solid #d1d1d6;
border-radius: 12px;
font: inherit;
font-size: 0.875rem;
font-weight: 600;
color: #c00;
cursor: pointer;
transition: background 0.15s, border-color 0.15s;
min-height: 44px;
}
.btn-reset:hover { background: #fff5f5; border-color: #c00; }
.btn-reset:active { background: #ffeaea; }
.btn-reset:focus-visible { outline: 3px solid #c00; outline-offset: 2px; }
.btn-reset svg { flex-shrink: 0; }

.history-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.history-item {
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
border-radius: 16px;
padding: 16px 18px;
box-shadow: 0 1px 4px rgba(0,0,0,0.04);
min-height: 64px;
}
.history-day { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.history-date { font-size: 1rem; font-weight: 600; color: #1d1d1f; }
.history-weekday { font-size: 0.75rem; font-weight: 500; color: #86868b; text-transform: capitalize; }
.history-steps { display: flex; align-items: baseline; gap: 6px; text-align: left; }
.steps-count { font-size: 1.375rem; font-weight: 800; color: #1d1d1f; font-variant-numeric: tabular-nums; }
.steps-unit { font-size: 0.875rem; font-weight: 500; color: #86868b; }

.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 12px;
padding: 48px 24px;
text-align: center;
color: #86868b;
}
.empty-state svg { opacity: 0.4; }
.empty-state p { font-size: 1.125rem; font-weight: 600; color: #1d1d1f; }
.empty-state span { font-size: 0.9375rem; }

.bottom-nav {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 50;
display: flex;
background: rgba(255,255,255,0.95);
backdrop-filter: saturate(180%) blur(20px);
border-top: 1px solid rgba(0,0,0,0.06);
padding: 8px 0 10px;
}
.nav-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
padding: 6px 12px;
background: transparent;
border: none;
font: inherit;
font-size: 0.7rem;
font-weight: 600;
color: #86868b;
cursor: pointer;
transition: color 0.15s;
min-height: 56px;
}
.nav-item svg { width: 24px; height: 24px; stroke-width: 2; transition: stroke 0.15s; }
.nav-item.active { color: #007aff; }
.nav-item.active svg { stroke: #007aff; }
.nav-item:focus-visible { outline: 3px solid #007aff; outline-offset: -3px; border-radius: 12px; }

@media (max-width: 390px) {
#step-count { font-size: 5.5rem; }
.btn-increment { max-width: 100%; padding: 16px 20px; font-size: 1rem; }
.quick-stats { gap: 8px; }
.stat { padding: 14px 8px; }
.stat-value { font-size: 1.375rem; }
}
