body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 15px;
    background-color: #f4f4f4;
    font-size: 16px;
}
h1 {
    color: #333;
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 15px;
}
form {
    margin-bottom: 15px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
label {
    margin: 8px 0;
    display: block;
    font-weight: bold;
    font-size: 1em;
}
input, select {
    padding: 12px;
    margin: 5px 0;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 6px;
    touch-action: manipulation;
}
button {
    padding: 12px;
    margin: 5px 0;
    font-size: 1.1em;
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 6px;
    background-color: #28a745;
    color: white;
    cursor: pointer;
    touch-action: manipulation;
}
button:hover {
    background-color: #218838;
}
button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
}
ul {
    list-style: none;
    padding: 0;
}
li {
    padding: 10px;
    background: white;
    margin: 5px 0;
    border-radius: 6px;
}
a {
    color: #007bff;
    text-decoration: none;
    font-size: 1em;
}
a:hover {
    text-decoration: underline;
}
p {
    text-align: center;
    font-size: 1em;
}
.consumed-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.consumable-card {
    display: flex;
    align-items: center;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.card-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 6px;
    cursor: pointer;
}
.card-content {
    flex: 1;
}
.card-content h3 {
    margin: 0 0 5px;
    font-size: 1.2em;
}
.card-content p {
    margin: 5px 0;
    font-size: 1em;
}
.options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.options button {
    background: #007bff;
    color: white;
    padding: 10px;
    font-size: 0.9em;
    border-radius: 6px;
}
.options button:hover {
    background: #0056b3;
}
.options button:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}
.option {
    margin-bottom: 8px;
}
#add-consumable-btn {
    background: #ff9500;
    padding: 12px;
    font-size: 1.2em;
    width: 100%;
    margin-bottom: 15px;
    border-radius: 6px;
}
#add-consumable-btn:hover {
    background: #e68a00;
}
#add-consumable-btn:focus {
    box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.3);
}
#add-consumable-form {
    display: none;
    margin-bottom: 15px;
    margin-top: 10px;
}
#take-photo-btn {
    display: block;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    margin-top: 10px;
    width: 100%;
}
#take-photo-btn:hover {
    background-color: #45a049;
}
#take-photo-btn:focus {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}
.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #f3f3f3;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}
.progress-bar.hidden {
    display: none;
}
.progress-fill {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.2s ease-in-out;
}
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px;
}
.gallery-item {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}
.gallery-image {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 10px;
}
.gallery-item p {
    margin: 5px 0;
    font-size: 0.9em;
}
.consumable-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.delete-btn {
    background: #dc3545;
    padding: 8px;
    font-size: 0.9em;
    order: -1;
}
.delete-btn:hover {
    background: #c82333;
}
.delete-btn:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3);
}
.delete-form {
    display: inline;
}
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}
.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
    animation: slideIn 0.3s ease-in-out;
}
.close {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 1.5em;
    color: #333;
}
.close:hover {
    color: #dc3545;
}
.consumption-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.consumption-table th, .consumption-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
.consumption-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}
.consumption-table tr:hover {
    background: #f1f3f5;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
#total-consumption-btn {
    background: #007bff;
    padding: 12px;
    font-size: 1.2em;
    width: 100%;
    margin-bottom: 15px;
    border-radius: 6px;
}
#total-consumption-btn:hover {
    background: #0056b3;
}
#total-consumption-btn:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    h1 {
        font-size: 1.3em;
    }
    .consumable-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .card-image {
        width: 100%;
        height: auto;
        max-width: 150px;
        margin: 0 0 10px;
    }
    .card-content {
        width: 100%;
    }
    .options {
        flex-direction: column;
    }
    .options button {
        width: 100%;
    }
    .consumption-table th, .consumption-table td {
        font-size: 0.9em;
        padding: 8px;
    }
    .gallery {
        grid-template-columns: 1fr;
    }
    .gallery-image {
        max-height: 150px;
    }
}