/**
 * TSI Chef Agent & Visual Inspector Styles
 * @version 1.1.0
 * @description Complete styling for Field-to-Fork education system
 * @brand Translator Series Inc.
 */

/* =========================================================================
   CSS VARIABLES
   ========================================================================= */
:root {
    --tsi-orange: #FF6600;
    --tsi-orange-light: #FF8533;
    --tsi-orange-dark: #CC5200;
    --tsi-green: #00FF00;
    --tsi-green-dim: #00CC00;
    --tsi-yellow: #FFCC00;
    --tsi-red: #FF0000;
    --tsi-dark: #1a1a1a;
    --tsi-darker: #0a0a0a;
    --tsi-light: #f5f5f5;

    --glass-bg: rgba(0, 0, 0, 0.75);
    --glass-bg-light: rgba(0, 0, 0, 0.5);
    --glass-border: rgba(255, 102, 0, 0.3);

    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow-orange: 0 0 20px rgba(255, 102, 0, 0.3);
    --shadow-glow-green: 0 0 20px rgba(0, 255, 0, 0.3);
    --shadow-glow-red: 0 0 20px rgba(255, 0, 0, 0.3);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(10, 10, 10, 0.9);
        --glass-bg-light: rgba(20, 20, 20, 0.8);
    }
}

/* =========================================================================
   CHEF PANEL
   ========================================================================= */
.chef-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    color: #fff;
    font-family: var(--font-primary);
    max-width: 800px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.chef-panel * {
    box-sizing: border-box;
}

/* Header */
.chef-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: wrap;
}

.chef-header .species-thumb {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--tsi-orange);
}

.chef-header .header-text {
    flex: 1;
    min-width: 200px;
}

.chef-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chef-header .scientific-name {
    margin: 4px 0 0;
    font-style: italic;
    opacity: 0.7;
    font-size: 0.9em;
}

.chef-icon {
    font-size: 1.8em;
}

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

.btn-share, .btn-pdf {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
}

.btn-share {
    background: var(--tsi-orange);
    color: white;
}

.btn-share:hover {
    background: var(--tsi-orange-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-orange);
}

.btn-pdf {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-pdf:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Tabs */
.chef-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 20px;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.chef-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
    font-size: 0.95em;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 102, 0, 0.1);
}

.tab-btn.active {
    color: var(--tsi-orange);
    border-bottom-color: var(--tsi-orange);
}

.tab-btn:focus {
    outline: 2px solid var(--tsi-orange);
    outline-offset: -2px;
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

.tab-content.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Urgency Badges */
.urgency-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 0.9em;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.urgency-badge.immediate {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    color: #fff;
    animation: pulse-urgent 1.5s infinite;
}

.urgency-badge.high {
    background: linear-gradient(135deg, #FF6600, #CC5200);
    color: #fff;
}

.urgency-badge.moderate {
    background: linear-gradient(135deg, #FFCC00, #E6B800);
    color: #000;
}

@keyframes pulse-urgent {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255, 0, 0, 0); }
}

.urgency-reason {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    margin-bottom: 16px;
}

/* Info Boxes */
.info-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.info-box p {
    margin: 8px 0;
}

.info-box strong {
    color: var(--tsi-orange);
}

/* Lists */
.chef-panel h4 {
    color: var(--tsi-orange);
    margin: 20px 0 12px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chef-panel ul, .chef-panel ol {
    padding-left: 24px;
    margin: 0 0 16px;
}

.chef-panel li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.steps-list {
    list-style: none;
    padding: 0;
    counter-reset: step-counter;
}

.step-item {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--tsi-orange);
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    position: relative;
}

.step-item::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: -18px;
    top: 16px;
    width: 32px;
    height: 32px;
    background: var(--tsi-orange);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85em;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.step-header strong {
    font-size: 1.05em;
}

.step-duration {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.7);
}

.step-tools {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
}

.step-caution {
    background: rgba(255, 204, 0, 0.15);
    border-left: 3px solid var(--tsi-yellow);
    padding: 8px 12px;
    margin-top: 10px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9em;
    color: var(--tsi-yellow);
}

.step-tips {
    color: var(--tsi-green-dim);
    font-size: 0.9em;
    margin-top: 8px;
}

/* Yield Badge */
.yield-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.1), rgba(0, 200, 0, 0.05));
    border: 1px solid rgba(0, 255, 0, 0.2);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.yield-badge .yield-icon {
    font-size: 1.4em;
}

.yield-badge strong {
    color: var(--tsi-green);
}

.yield-percent {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
}

/* Cuts Grid */
.cuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.cut-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 14px;
}

.cut-item h5 {
    color: var(--tsi-orange);
    margin: 0 0 8px;
    font-size: 0.95em;
    text-transform: capitalize;
}

.cut-item p {
    margin: 0;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

/* Storage Cards */
.storage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.storage-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: 16px;
}

.storage-card.fresh {
    border-left: 3px solid #00BFFF;
}

.storage-card.frozen {
    border-left: 3px solid #87CEEB;
}

.storage-card h5 {
    margin: 0 0 12px;
    font-size: 1em;
}

.storage-card p {
    margin: 6px 0;
    font-size: 0.9em;
}

/* Warning Box */
.warning-box {
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--tsi-yellow);
    font-weight: 500;
}

/* Methods & Pairings Chips */
.methods-chips, .pairings-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.method-chip, .pairing-chip {
    background: rgba(255, 102, 0, 0.15);
    border: 1px solid rgba(255, 102, 0, 0.3);
    color: var(--tsi-orange);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
}

.pairing-chip {
    background: rgba(0, 255, 0, 0.1);
    border-color: rgba(0, 255, 0, 0.2);
    color: var(--tsi-green);
}

/* Temperature Grid */
.temp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.temp-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
}

.temp-label {
    display: block;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
    text-transform: capitalize;
    margin-bottom: 4px;
}

.temp-value {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--tsi-orange);
}

/* Severity Legend */
.severity-legend {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.severity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border-left: 4px solid;
}

.severity-icon {
    font-size: 1.2em;
}

.severity-level {
    font-weight: 700;
    width: 80px;
}

.severity-action {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
}

/* Disease Cards */
.disease-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    border-left: 4px solid;
}

.disease-card.severity-critical {
    border-left-color: var(--tsi-red);
}

.disease-card.severity-high {
    border-left-color: var(--tsi-orange);
}

.disease-card.severity-moderate {
    border-left-color: var(--tsi-yellow);
}

.disease-card.severity-low {
    border-left-color: var(--tsi-green);
}

.disease-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.disease-header h5 {
    margin: 0;
    font-size: 1.1em;
    color: #fff;
}

.severity-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
}

.severity-badge.critical {
    background: var(--tsi-red);
    color: white;
}

.severity-badge.high {
    background: var(--tsi-orange);
    color: white;
}

.severity-badge.moderate {
    background: var(--tsi-yellow);
    color: black;
}

.severity-badge.low {
    background: var(--tsi-green);
    color: black;
}

.zoonotic-badge {
    background: rgba(255, 0, 0, 0.2);
    color: var(--tsi-red);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 700;
}

.disease-signs {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.signs-category h6 {
    color: var(--tsi-orange);
    margin: 0 0 8px;
    font-size: 0.9em;
}

.signs-category ul {
    margin: 0;
    padding-left: 20px;
}

.signs-category li {
    font-size: 0.9em;
    margin-bottom: 4px;
}

.disease-handling, .disease-testing, .disease-report {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.disease-handling h6, .disease-testing h6 {
    color: var(--tsi-orange);
    margin: 0 0 8px;
    font-size: 0.9em;
}

.disease-testing p {
    margin: 4px 0;
    font-size: 0.85em;
}

.disease-report {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

/* Aging Recommendation */
.aging-rec {
    background: rgba(255, 102, 0, 0.1);
    border: 1px solid rgba(255, 102, 0, 0.2);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-top: 16px;
}

/* Footer */
.chef-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.chef-footer .disclaimer {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin: 0 0 8px;
}

.chef-footer .version {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

/* Error state */
.chef-error {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.6);
}

/* =========================================================================
   VISUAL INSPECTOR
   ========================================================================= */
.visual-inspector {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    color: #fff;
    font-family: var(--font-primary);
}

.inspector-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.inspector-icon {
    font-size: 1.8em;
}

.inspector-header h3 {
    margin: 0;
    font-size: 1.3em;
    flex: 1;
}

.ai-badge {
    background: linear-gradient(135deg, var(--tsi-orange), #FF3300);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7em;
    font-weight: 700;
    animation: pulse-ai 2s infinite;
}

@keyframes pulse-ai {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px rgba(255, 102, 0, 0.5); }
    50% { opacity: 0.8; box-shadow: 0 0 20px rgba(255, 102, 0, 0.8); }
}

/* Top Controls */
.inspector-controls-top {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.species-select-wrapper, .state-select-wrapper {
    flex: 1;
    min-width: 140px;
}

.species-select-wrapper label, .state-select-wrapper label {
    display: block;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

.species-select-wrapper select, .state-select-wrapper select {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 0.9em;
    cursor: pointer;
}

.species-select-wrapper select:focus, .state-select-wrapper select:focus {
    outline: 2px solid var(--tsi-orange);
    outline-offset: 2px;
}

/* Camera Viewport */
.camera-viewport {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
}

#inspector-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#inspector-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

#inspector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    color: rgba(255, 255, 255, 0.5);
}

.camera-placeholder.hidden {
    display: none;
}

.camera-placeholder .placeholder-icon {
    font-size: 3em;
    margin-bottom: 12px;
    opacity: 0.3;
}

.scan-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.scan-overlay.active {
    opacity: 1;
}

.scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--tsi-green), transparent);
    animation: scan 1.5s linear infinite;
    box-shadow: 0 0 15px var(--tsi-green);
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

/* Inspector Controls */
.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.controls button {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.controls button.hidden {
    display: none;
}

.btn-primary {
    background: var(--tsi-orange);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--tsi-orange-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-orange);
}

.btn-accent {
    background: var(--tsi-green);
    color: #000;
}

.btn-accent:hover:not(:disabled) {
    background: var(--tsi-green-dim);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-green);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.btn-secondary.active {
    background: var(--tsi-orange);
    border-color: var(--tsi-orange);
}

.btn-danger {
    background: var(--tsi-red);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #CC0000;
}

/* Result Display */
.result-display {
    animation: fadeIn 0.4s ease;
}

.result-display.hidden {
    display: none;
}

/* Stamps */
.stamp {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 700;
    border: 4px solid;
    margin: 0 auto 24px;
    animation: stampIn 0.5s ease-out;
}

@keyframes stampIn {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    50% { transform: scale(1.15) rotate(5deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.stamp.green-stamp {
    background: rgba(0, 255, 0, 0.1);
    color: var(--tsi-green);
    border-color: var(--tsi-green);
    box-shadow: var(--shadow-glow-green);
}

.stamp.caution {
    background: rgba(255, 204, 0, 0.1);
    color: var(--tsi-yellow);
    border-color: var(--tsi-yellow);
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
}

.stamp.red-flag {
    background: rgba(255, 0, 0, 0.1);
    color: var(--tsi-red);
    border-color: var(--tsi-red);
    box-shadow: var(--shadow-glow-red);
    animation: stampIn 0.5s ease-out, warning 1.5s infinite;
}

@keyframes warning {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 0, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 0, 0, 0.6); }
}

.stamp-icon {
    font-size: 2.5em;
}

.stamp-text {
    font-size: 1em;
    letter-spacing: 2px;
    margin-top: 4px;
}

.stamp-subtext {
    font-size: 0.7em;
    opacity: 0.8;
    font-weight: 500;
}

.stamp-confidence {
    font-size: 0.75em;
    opacity: 0.7;
    margin-top: 4px;
}

/* State Alert */
.state-alert {
    background: rgba(255, 204, 0, 0.15);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
    color: var(--tsi-yellow);
    font-size: 0.9em;
}

.state-alert.critical {
    background: rgba(255, 0, 0, 0.15);
    border-color: rgba(255, 0, 0, 0.3);
    color: var(--tsi-red);
}

/* Result Details */
.result-details {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 20px;
}

.result-details h4 {
    color: var(--tsi-orange);
    margin: 16px 0 12px;
    font-size: 1em;
}

.result-details h4:first-child {
    margin-top: 0;
}

.analysis-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.health-metrics {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.metric {
    text-align: center;
}

.metric-label {
    display: block;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.metric-value {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--tsi-green);
}

.metric-value.trend-improving {
    color: var(--tsi-green);
}

.metric-value.trend-stable {
    color: var(--tsi-yellow);
}

.metric-value.trend-declining {
    color: var(--tsi-red);
}

.checked-list, .healthy-list, .practices-list, .recommendations-list, .actions-list {
    padding-left: 20px;
    margin: 0 0 16px;
}

.checked-list li, .healthy-list li, .practices-list li {
    margin-bottom: 6px;
    font-size: 0.9em;
}

.healthy-list li {
    color: var(--tsi-green);
}

.actions-list.critical li {
    color: var(--tsi-red);
}

/* Concern/Warning Cards */
.concern-card, .warning-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 12px;
}

.concern-card {
    border-left: 3px solid var(--tsi-yellow);
}

.warning-card {
    border-left: 3px solid var(--tsi-red);
}

.concern-header, .warning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.concern-severity, .warning-severity {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.7em;
    font-weight: 600;
}

.concern-severity.moderate, .warning-severity.moderate {
    background: var(--tsi-yellow);
    color: black;
}

.concern-severity.high, .warning-severity.high {
    background: var(--tsi-orange);
    color: white;
}

.warning-severity.critical {
    background: var(--tsi-red);
    color: white;
}

.concern-confidence {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
}

.concern-issue, .warning-description {
    margin: 0 0 6px;
    font-size: 0.9em;
}

.concern-location, .warning-affected {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 6px;
}

.concern-recommendation, .warning-action {
    font-size: 0.85em;
    margin: 0;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Reporting Info */
.reporting-info {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-top: 16px;
}

.reporting-info h5 {
    color: var(--tsi-red);
    margin: 0 0 8px;
    font-size: 0.9em;
}

.reporting-info p {
    margin: 4px 0;
    font-size: 0.85em;
}

/* Disclaimer Box */
.disclaimer-box {
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-top: 20px;
}

.disclaimer-box p {
    margin: 0;
    font-size: 0.85em;
    color: var(--tsi-yellow);
    line-height: 1.5;
}

/* Scan Meta */
.scan-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.scan-meta span {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-mono);
}

/* Inspector Footer */
.inspector-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.inspector-footer .disclaimer {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin: 0 0 8px;
}

.inspector-footer .disclaimer strong {
    color: var(--tsi-red);
}

.inspector-footer .version {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.3);
    margin: 0;
}

/* =========================================================================
   ACCESSIBILITY
   ========================================================================= */
button:focus, select:focus, input:focus {
    outline: 2px solid var(--tsi-orange);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 600px) {
    .chef-panel {
        padding: 16px;
        border-radius: var(--radius-md);
    }

    .chef-header {
        flex-direction: column;
        text-align: center;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .chef-tabs {
        justify-content: flex-start;
    }

    .tab-btn {
        padding: 10px 14px;
        font-size: 0.85em;
    }

    .storage-grid, .cuts-grid, .temp-grid {
        grid-template-columns: 1fr;
    }

    .step-item::before {
        left: -16px;
        width: 28px;
        height: 28px;
        font-size: 0.8em;
    }

    .visual-inspector {
        padding: 16px;
    }

    .controls {
        flex-direction: column;
    }

    .controls button {
        width: 100%;
        justify-content: center;
    }

    .stamp {
        width: 130px;
        height: 130px;
    }

    .stamp-icon {
        font-size: 2em;
    }

    .health-metrics {
        flex-direction: column;
        align-items: center;
    }
}

/* Print styles */
@media print {
    .chef-panel, .visual-inspector {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .btn-share, .btn-pdf, .controls, .camera-viewport {
        display: none !important;
    }
}

/* =========================================================================
   AR HARVEST INSPECTOR STYLES
   ========================================================================= */
.ar-controls {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.ar-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
}

.ar-status .status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #666;
    transition: var(--transition-normal);
}

.ar-status .status-indicator.active {
    background: var(--tsi-green);
    box-shadow: var(--shadow-glow-green);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 0, 0.5); }
    50% { box-shadow: 0 0 25px rgba(0, 255, 0, 0.8); }
}

.ar-status .status-text {
    font-size: 0.9rem;
    color: var(--tsi-light);
}

.ar-mode-selector {
    margin-bottom: 1rem;
}

.ar-mode-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.ar-mode-selector select {
    width: 100%;
    padding: 0.6rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--tsi-light);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.ar-mode-selector select:hover {
    border-color: var(--tsi-orange);
}

.ar-mode-selector select:focus {
    outline: none;
    border-color: var(--tsi-orange);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.2);
}

.ar-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ar-buttons button {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.ar-buttons .btn-primary {
    background: linear-gradient(135deg, var(--tsi-orange), var(--tsi-orange-dark));
    color: white;
}

.ar-buttons .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--tsi-orange-light), var(--tsi-orange));
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-orange);
}

.ar-buttons .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--tsi-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ar-buttons .btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--tsi-orange);
}

.ar-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ar-auto-analyze {
    margin-bottom: 1rem;
}

.ar-auto-analyze label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.ar-auto-analyze input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--tsi-orange);
    cursor: pointer;
}

/* AR Summary Panel */
.ar-summary {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.ar-summary h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--tsi-orange);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ar-summary .summary-overall {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.ar-summary .summary-overall.assessment-do-not-consume {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.3), rgba(200, 0, 0, 0.3));
    color: #FF4444;
    border: 2px solid #FF0000;
    animation: danger-pulse 1s infinite;
}

@keyframes danger-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ar-summary .summary-overall.assessment-extreme-caution {
    background: rgba(255, 68, 68, 0.2);
    color: #FF6666;
    border: 1px solid #FF4444;
}

.ar-summary .summary-overall.assessment-inspect-carefully {
    background: rgba(255, 170, 0, 0.2);
    color: #FFAA00;
    border: 1px solid #FF8800;
}

.ar-summary .summary-overall.assessment-cook-thoroughly {
    background: rgba(255, 204, 0, 0.2);
    color: #FFCC00;
    border: 1px solid #FFAA00;
}

.ar-summary .summary-overall.assessment-appears-healthy {
    background: rgba(0, 255, 0, 0.2);
    color: var(--tsi-green);
    border: 1px solid var(--tsi-green-dim);
}

.ar-summary .summary-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.ar-summary .summary-counts span {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
}

.ar-summary .summary-counts .critical {
    background: rgba(255, 0, 0, 0.3);
    color: #FF4444;
}

.ar-summary .summary-counts .high {
    background: rgba(255, 68, 0, 0.3);
    color: #FF6644;
}

.ar-summary .summary-counts .moderate {
    background: rgba(255, 170, 0, 0.3);
    color: #FFAA00;
}

.ar-summary .summary-counts .safe {
    background: rgba(0, 255, 0, 0.2);
    color: var(--tsi-green);
}

/* AR Canvas Container */
.ar-canvas-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
}

.ar-canvas-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.ar-canvas-container .ar-overlay-info {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--tsi-light);
}

.ar-canvas-container .ar-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 2px solid var(--tsi-orange);
    border-radius: 50%;
    pointer-events: none;
}

.ar-canvas-container .ar-crosshair::before,
.ar-canvas-container .ar-crosshair::after {
    content: '';
    position: absolute;
    background: var(--tsi-orange);
}

.ar-canvas-container .ar-crosshair::before {
    width: 20px;
    height: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ar-canvas-container .ar-crosshair::after {
    width: 2px;
    height: 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* AR Marker Tooltips */
.ar-marker-tooltip {
    position: absolute;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--tsi-light);
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
    border: 1px solid var(--glass-border);
}

.ar-marker-tooltip.critical {
    border-color: #FF0000;
    background: rgba(255, 0, 0, 0.2);
}

.ar-marker-tooltip.warning {
    border-color: #FF6600;
    background: rgba(255, 102, 0, 0.2);
}

.ar-marker-tooltip.caution {
    border-color: #FFCC00;
    background: rgba(255, 204, 0, 0.2);
}

.ar-marker-tooltip.healthy {
    border-color: var(--tsi-green);
    background: rgba(0, 255, 0, 0.2);
}

/* CookState Gauger Integration Styles */
.cook-gauger-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.gauger-header h2 {
    margin: 0 0 0.25rem 0;
    color: var(--tsi-orange);
}

.gauger-subtitle {
    margin: 0 0 1rem 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.gauger-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.gauger-controls select {
    width: 100%;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--tsi-light);
    font-size: 0.9rem;
}

.temp-input-section {
    margin-bottom: 1.5rem;
}

.temp-input-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.temp-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.temp-input-wrapper input {
    flex: 1;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--tsi-light);
    font-size: 1.1rem;
    text-align: center;
}

.temp-input-wrapper .temp-unit {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
}

.temp-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.temp-presets .temp-preset {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: var(--tsi-light);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.temp-presets .temp-preset:hover {
    background: var(--tsi-orange);
    border-color: var(--tsi-orange);
}

/* Doneness Result Display */
.doneness-result {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.doneness-indicator {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid currentColor;
}

.doneness-indicator.doneness-rare {
    background: linear-gradient(135deg, #FF4444, #CC0000);
    color: #FF4444;
}

.doneness-indicator.doneness-medium-rare {
    background: linear-gradient(135deg, #FF6666, #FF4444);
    color: #FF6666;
}

.doneness-indicator.doneness-medium {
    background: linear-gradient(135deg, #FF8888, #FF6666);
    color: #FFAA88;
}

.doneness-indicator.doneness-medium-well {
    background: linear-gradient(135deg, #CCAA88, #AA8866);
    color: #CCAA88;
}

.doneness-indicator.doneness-well-done {
    background: linear-gradient(135deg, #AA8866, #886644);
    color: #AA8866;
}

.doneness-info {
    display: flex;
    flex-direction: column;
}

.doneness-level {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--tsi-light);
}

.doneness-temp {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Safety Score Ring */
.safety-result {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.safety-score-ring {
    position: relative;
    width: 80px;
    height: 80px;
}

.safety-score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.safety-score-ring .score-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.safety-score-ring .score-fill {
    fill: none;
    stroke: var(--tsi-green);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

.safety-score-ring .score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tsi-light);
}

.safety-status {
    display: flex;
    flex-direction: column;
}

.safety-status .status-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.safety-status .status-value {
    font-size: 0.95rem;
    color: var(--tsi-light);
    margin-top: 0.25rem;
}

.safety-status .status-value.status-safe { color: var(--tsi-green); }
.safety-status .status-value.status-caution { color: var(--tsi-yellow); }
.safety-status .status-value.status-unsafe { color: #FF6644; }
.safety-status .status-value.status-critical_risk { color: #FF0000; }

/* Pathogens List */
.pathogens-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pathogen-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.pathogen-item.resolved {
    opacity: 0.6;
}

.pathogen-item.active {
    border-left: 3px solid #FF6644;
}

.pathogen-icon {
    font-size: 1.1rem;
}

.pathogen-item.resolved .pathogen-icon { color: var(--tsi-green); }
.pathogen-item.active .pathogen-icon { color: #FF6644; }

.pathogen-name {
    flex: 1;
    color: var(--tsi-light);
}

.pathogen-temp {
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.pathogen-status {
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pathogen-item.resolved .pathogen-status {
    background: rgba(0, 255, 0, 0.2);
    color: var(--tsi-green);
}

.pathogen-item.active .pathogen-status {
    background: rgba(255, 100, 68, 0.2);
    color: #FF6644;
}

/* Recommendations Section */
.recommendations-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.recommendations-section h3 {
    margin: 0 0 1rem 0;
    color: var(--tsi-orange);
    font-size: 1rem;
}

.warning-banner {
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid #FF4444;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #FF6666;
    font-size: 0.9rem;
}

.doneness-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.doneness-option {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.doneness-option.safe {
    border-color: rgba(0, 255, 0, 0.3);
}

.doneness-option.unsafe {
    border-color: rgba(255, 68, 68, 0.3);
    opacity: 0.6;
}

.doneness-option .option-name {
    display: block;
    font-weight: 600;
    color: var(--tsi-light);
    margin-bottom: 0.25rem;
}

.doneness-option .option-temp {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.doneness-option .option-desc {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
}

.doneness-option .option-safe {
    display: block;
    font-size: 0.7rem;
    margin-top: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    text-align: center;
}

.doneness-option.safe .option-safe {
    background: rgba(0, 255, 0, 0.2);
    color: var(--tsi-green);
}

.doneness-option.unsafe .option-safe {
    background: rgba(255, 68, 68, 0.2);
    color: #FF6644;
}

.species-notes {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255, 170, 0, 0.1);
    border-left: 3px solid var(--tsi-yellow);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* AR Mobile Responsiveness */
@media (max-width: 480px) {
    .ar-buttons {
        flex-direction: column;
    }

    .gauger-controls {
        grid-template-columns: 1fr;
    }

    .safety-result {
        flex-direction: column;
        text-align: center;
    }

    .doneness-options {
        grid-template-columns: 1fr;
    }
}
