.nt-container {
    padding: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.nt-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 14px;
}

.nt-table th, .nt-table td {
    border: 1px solid #ddd;
    padding: 8px 4px;
    text-align: center;
    word-break: break-word;
}

.nt-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 12px;
}

.nt-input-grams, .nt-input-calories, 
.nt-meal, .nt-time, .nt-food, 
.nt-protein, .nt-fat, .nt-carbs, 
.nt-calories, .nt-notes {
    width: 95%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    max-width: 100%;
    box-sizing: border-box;
}

.nt-progress-container {
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nt-progress-item {
    margin-bottom: 12px;
}

.nt-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
    flex-wrap: wrap;
}

.nt-progress-label span {
    margin-bottom: 2px;
}

.nt-progress-bar {
    width: 100%;
    height: 16px;
    background-color: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.nt-progress-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
}

.nt-progress-fill[data-macro="calories"] { background-color: #dc3545; }
.nt-progress-fill[data-macro="protein"] { background-color: #007bff; }
.nt-progress-fill[data-macro="fat"] { background-color: #ffc107; }
.nt-progress-fill[data-macro="carbs"] { background-color: #28a745; }

.nt-totals {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 5px;
    margin: 15px 0;
    text-align: center;
}

.nt-totals h3 {
    margin: 0;
    color: #495057;
    font-size: 16px;
    line-height: 1.4;
}

.nt-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.nt-buttons .button {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    font-size: 14px;
    white-space: nowrap;
}

.nt-date-selector {
    margin-bottom: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nt-date-selector label {
    font-weight: bold;
    font-size: 14px;
}

#nt-current-date {
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.nt-date-navigation {
    display: flex;
    gap: 8px;
}

.nt-date-navigation .button {
    flex: 1;
    padding: 8px;
}

.nt-history-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.nt-chart-container {
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.nt-chart-container canvas {
    max-width: 100%;
    height: auto;
}

.nt-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.nt-history-table th,
.nt-history-table td {
    padding: 8px 4px;
    border: 1px solid #ddd;
    text-align: center;
}

.button-small {
    padding: 4px 8px;
    font-size: 11px;
}

.nt-mobile-view {
    display: none;
}

.nt-meals-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nt-meal-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.nt-meal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.nt-meal-card-title {
    font-weight: bold;
    font-size: 14px;
}

.nt-meal-card-food {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

.nt-meal-card-macros {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 12px;
}

.nt-macro-item {
    display: flex;
    justify-content: space-between;
}

.nt-macro-value {
    font-weight: bold;
}

.nt-meal-card-notes {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #666;
}

.nt-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 15px;
}

.nt-mobile-actions {
    display: none;
    text-align: center;
    margin: 10px 0;
}

.nt-no-meals {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

@media (min-width: 768px) {
    .nt-container {
        padding: 20px;
    }
    
    .nt-table th, .nt-table td {
        padding: 12px 8px;
        font-size: 14px;
    }
    
    .nt-table th {
        font-size: 14px;
    }
    
    .nt-progress-label {
        font-size: 16px;
    }
    
    .nt-progress-bar {
        height: 20px;
    }
    
    .nt-totals h3 {
        font-size: 18px;
    }
    
    .nt-buttons .button {
        padding: 12px;
        font-size: 16px;
    }
    
    .nt-date-selector {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }
    
    .nt-date-navigation {
        flex: 0 0 auto;
    }
    
    .nt-history-charts {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .nt-history-table {
        font-size: 14px;
    }
    
    .nt-history-table th,
    .nt-history-table td {
        padding: 12px 8px;
    }
    
    .nt-mobile-view {
        display: none !important;
    }
    
    .nt-mobile-actions {
        display: none !important;
    }
    
    .desktop-only {
        display: block !important;
    }
}

@media (max-width: 767px) {
    .nt-table.desktop-only {
        display: none;
    }
    
    .nt-mobile-view {
        display: block;
    }
    
    .nt-mobile-actions {
        display: block;
    }
    
    .nt-progress-label {
        flex-direction: column;
        gap: 2px;
    }
    
    .nt-progress-label span {
        text-align: left;
    }
    
    .nt-buttons {
        flex-direction: column;
    }
    
    .nt-buttons .button {
        min-width: auto;
        width: 100%;
    }
    
    .nt-date-selector {
        text-align: center;
    }
    
    .nt-date-navigation {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .nt-container {
        padding: 10px;
    }
    
    .nt-progress-container {
        padding: 10px;
    }
    
    .nt-totals {
        padding: 8px;
    }
    
    .nt-totals h3 {
        font-size: 14px;
        line-height: 1.3;
    }
    
    .nt-chart-container {
        padding: 10px;
    }
    
    .nt-meal-card {
        padding: 8px;
    }
    
    .nt-input-grams, .nt-input-calories, 
    .nt-meal, .nt-time, .nt-food, 
    .nt-protein, .nt-fat, .nt-carbs, 
    .nt-calories, .nt-notes {
        font-size: 16px;
        padding: 8px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .button {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .nt-remove {
        min-height: 44px;
        padding: 12px;
    }
    
    input, select, textarea {
        font-size: 16px;
    }
}

.nt-loading {
    opacity: 0.6;
    pointer-events: none;
}

.nt-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: nt-spin 1s linear infinite;
}

@keyframes nt-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nt-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px;
    border-radius: 3px;
    margin: 10px 0;
}

.nt-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 10px;
    border-radius: 3px;
    margin: 10px 0;
}