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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    -webkit-text-size-adjust: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #d2d2d7;
    margin-bottom: 16px;
}

header h1 {
    font-size: 20px;
    font-weight: 600;
}

#user-name {
    font-size: 14px;
    color: #86868b;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

h3 {
    font-size: 14px;
    font-weight: 500;
    color: #86868b;
    margin-bottom: 8px;
}

.button-group {
    margin-bottom: 16px;
}

.button-group button {
    display: inline-block;
    padding: 10px 16px;
    margin: 4px;
    border: 2px solid #d2d2d7;
    border-radius: 10px;
    background: white;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.15s;
}

.button-group button:active {
    transform: scale(0.97);
}

.button-group button.selected {
    border-color: #0071e3;
    background: #e8f0fe;
    color: #0071e3;
    font-weight: 600;
}

.conditional-fields {
    margin-bottom: 12px;
}

.conditional-fields input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 15px;
    background: white;
}

.primary-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: #0071e3;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: opacity 0.15s;
}

.primary-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.primary-btn:active:not(:disabled) {
    opacity: 0.8;
}

.secondary-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: 2px solid #d2d2d7;
    border-radius: 12px;
    background: white;
    color: #1d1d1f;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.15s;
}

.secondary-btn:active {
    opacity: 0.8;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #86868b;
    margin-bottom: 4px;
}

.form-group input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 15px;
    background: white;
}

.hint {
    color: #86868b;
    font-size: 14px;
    margin-top: 12px;
}

#trip-category-display {
    font-size: 16px;
    font-weight: 600;
    text-transform: capitalize;
    margin-bottom: 4px;
}

.trip-card {
    background: white;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.trip-card .trip-date {
    font-size: 13px;
    color: #86868b;
}

.trip-card .trip-category {
    font-size: 15px;
    font-weight: 600;
    text-transform: capitalize;
}

.trip-card .trip-miles {
    font-size: 14px;
    color: #515154;
}

.home-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.home-actions .secondary-btn {
    flex: 1;
}

.year-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.year-nav {
    padding: 8px 14px;
    border: 2px solid #d2d2d7;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    cursor: pointer;
}

.year-nav:active {
    opacity: 0.7;
}

#report-year {
    font-size: 20px;
    font-weight: 600;
}

.summary-card {
    background: white;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-card .cat-name {
    font-size: 15px;
    font-weight: 600;
    text-transform: capitalize;
}

.summary-card .cat-count {
    font-size: 13px;
    color: #86868b;
}

.summary-card .cat-miles {
    font-size: 16px;
    font-weight: 600;
    color: #0071e3;
}

.summary-total {
    background: #0071e3;
    color: white;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-total .total-label {
    font-size: 15px;
    font-weight: 500;
}

.summary-total .total-miles {
    font-size: 20px;
    font-weight: 700;
}

.vehicle-card {
    background: white;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vehicle-label {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
}

.vehicle-status {
    font-size: 13px;
    color: #86868b;
}

.vehicle-actions {
    display: flex;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
}

.small-btn {
    padding: 6px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    background: white;
    font-size: 13px;
    cursor: pointer;
}

.small-btn:active {
    opacity: 0.7;
}

.small-btn.danger {
    color: #ff3b30;
    border-color: #ff3b30;
}

.odometer-row {
    background: white;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.odometer-date {
    font-size: 14px;
    color: #86868b;
}

.odometer-value {
    font-size: 15px;
    font-weight: 600;
}

.clickable {
    cursor: pointer;
}

.trip-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trip-address {
    font-size: 13px;
    color: #86868b;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
}

.detail-label {
    color: #86868b;
    font-weight: 500;
}

.autocomplete-wrap {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d2d2d7;
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 10px 12px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:active {
    background: #e8f0fe;
}

.save-place-form {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    align-items: center;
}

.save-place-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 14px;
}

.save-place-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: #0071e3;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.save-place-btn:disabled {
    opacity: 0.4;
}

.january-banner {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    cursor: pointer;
}
