.cit-wrap {
    max-width: 960px;
    margin: 24px 0;
    padding: 22px;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.cit-wrap h3 {
    margin-top: 0;
}

.cit-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.cit-field label,
.cit-filter-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.cit-field input,
.cit-field select,
.cit-filter-form select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d7d7d7;
    border-radius: 8px;
    padding: 8px 10px;
}

.cit-full {
    grid-column: 1 / -1;
}

.cit-total-box {
    padding: 14px;
    border-radius: 10px;
    background: #f7f7f7;
    font-size: 18px;
}

.cit-total-box small {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    opacity: 0.75;
}

.cit-actions button,
.cit-filter-form button {
    border: 0;
    border-radius: 8px;
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 700;
    background: #1f2937;
    color: #ffffff;
}

.cit-message {
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 8px;
}

.cit-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.cit-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.cit-table-scroll {
    overflow-x: auto;
}

.cit-table {
    width: 100%;
    border-collapse: collapse;
}

.cit-table th,
.cit-table td {
    border: 1px solid #e5e7eb;
    padding: 10px;
    text-align: left;
}

.cit-table th {
    background: #f9fafb;
}

.cit-filter-form {
    display: flex;
    gap: 10px;
    align-items: end;
    margin-bottom: 18px;
}

@media (max-width: 768px) {
    .cit-form {
        grid-template-columns: 1fr;
    }

    .cit-filter-form {
        display: block;
    }

    .cit-filter-form button {
        margin-top: 10px;
    }
}

.cit-food-box {
    padding: 12px 14px;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
}

.cit-food-box h4 {
    margin: 0 0 6px;
}

.cit-help {
    margin: 0;
    font-size: 13px;
    opacity: 0.78;
}

.cit-field input[type="file"] {
    padding: 8px;
    background: #fff;
}


.cit-plan-summary {
    margin: 18px 0;
    padding: 14px;
    border-radius: 10px;
    background: #f7f7f7;
    line-height: 1.7;
}

.cit-meal-form {
    margin-top: 16px;
}

.cit-icon-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cit-inline-delete-form {
    margin: 0;
}

.cit-icon-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
}

.cit-delete-button {
    background: #f3f4f6;
    color: #111827;
}

.cit-hidden-detail {
    display: none;
}

.cit-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.cit-modal.cit-modal-open {
    display: block;
}

.cit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.cit-modal-panel {
    position: relative;
    max-width: 680px;
    max-height: 82vh;
    overflow-y: auto;
    margin: 8vh auto;
    padding: 22px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.25);
}

.cit-modal-panel h4 {
    margin-top: 0;
    padding-right: 36px;
}

.cit-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: 0;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.cit-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}

.cit-detail-grid p {
    margin: 0;
    padding: 10px;
    border-radius: 8px;
    background: #f9fafb;
}

.cit-message a {
    font-weight: 700;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .cit-modal-panel {
        width: calc(100% - 28px);
        margin: 6vh auto;
    }

    .cit-detail-grid {
        grid-template-columns: 1fr;
    }
}

.cit-processing {
    display: none;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    align-items: center;
    gap: 12px;
}

.cit-processing.cit-processing-open {
    display: flex;
}

.cit-processing span {
    display: block;
    font-size: 13px;
    opacity: 0.8;
}

.cit-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid #bfdbfe;
    border-top-color: #1d4ed8;
    border-radius: 50%;
    animation: cit-spin 0.8s linear infinite;
    flex: 0 0 auto;
}

@keyframes cit-spin {
    to { transform: rotate(360deg); }
}


.cit-actions button:disabled,
.cit-disabled-button {
    opacity: 0.55;
    cursor: not-allowed;
}

.cit-food-thumb {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.cit-food-thumb-link {
    display: inline-block;
    line-height: 0;
}

.cit-report-thumbs {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.cit-scan-upload-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}


.cit-upload-or {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    height: 52px;
    padding: 0 2px;
    color: #4b5563;
    font-weight: 700;
    line-height: 1;
}

.cit-upload-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 52px;
    height: 52px;
    padding: 0 22px !important;
    border-radius: 8px;
    background: #1f2937;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2 !important;
    text-align: center;
    vertical-align: middle;
    box-sizing: border-box;
}


.cit-scan-upload-actions 
.cit-upload-or {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    height: 52px;
    padding: 0 2px;
    color: #4b5563;
    font-weight: 700;
    line-height: 1;
}

.cit-upload-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 52px;
    min-height: 52px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.cit-upload-secondary {
    background: #4b5563;
}

.cit-visually-hidden-file {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.cit-warning {
    margin-top: 8px;
    color: #92400e;
    opacity: 1;
}

.cit-food-preview {
    margin-top: 14px;
}

.cit-preview-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}

.cit-preview-card img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.cit-preview-card span {
    font-size: 13px;
    font-weight: 600;
    word-break: break-word;
}


.cit-hidden {
    display: none !important;
}

.cit-scan-meal-button {
    border: 0 !important;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    font-size: inherit;
    margin-top: 0;
}

.cit-actions .cit-scan-meal-button {
    width: auto;
}

.cit-barcode-number-wrap {
    margin-top: 12px;
}

.cit-barcode-number-wrap label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.cit-barcode-number-input {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

.cit-optional {
    font-weight: 400;
    opacity: 0.75;
}
