:root {
    /* Color Palette */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --tomato-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);

    --bg-dark: #0f0f23;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);

    --text-primary: #ffffff;
    --text-secondary: #b4b4c8;
    --text-muted: #6b6b8c;

    --border-color: rgba(255, 255, 255, 0.1);
    --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);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(at 0% 0%, rgba(102, 126, 234, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(245, 87, 108, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--spacing-md);
    padding-top: 100px;
    /* Offset for sticky nav */
}

/* Tab Management */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Nav Bar Styles */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 15, 35, 0.95);
    border-bottom: 1px solid var(--border-color);
}

.text-up {
    color: #22c55e !important;
}

.text-down {
    color: #ef4444 !important;
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 700;
    font-size: 1.25rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    cursor: pointer;
}

.logo-emoji {
    -webkit-text-fill-color: initial;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active {
    border-bottom-color: #667eea;
}

/* Mobile Menu Button */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    body.mobile-menu-open {
        overflow: hidden;
    }

    .nav-container {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(15, 15, 35, 0.98);
        flex-direction: column;
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        max-height: calc(100dvh - 64px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
        z-index: 1200;
    }

    .nav-links.active {
        display: flex;
        animation: fadeInDown 0.3s ease;
    }

    .nav-link {
        display: block;
        padding: 0.75rem;
        border-radius: var(--radius-sm);
        border-bottom: none;
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(255, 255, 255, 0.1);
        border-bottom: none;
    }
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: var(--spacing-xl) 0;
    margin-bottom: var(--spacing-xl);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-sm);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 20;
}

.service-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xl) var(--spacing-lg);
    position: relative;
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.05);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.header-content {
    background: rgba(20, 20, 35, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.tomato-icon {
    font-size: 3rem;
    animation: bounce 2s infinite;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--tomato-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Card Styles */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    animation: fadeInUp 0.6s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

/* Form Styles */
.production-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: var(--spacing-md);
    align-items: end;
}

#tracker .main-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

#tracker .header {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Button Styles */
.btn-primary {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.875rem 1.5rem;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active,
.btn-primary.active {
    transform: translateY(0);
    background: var(--success-gradient);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Window Button Active State (Overrides inline styles) */
.win-btn-open.active,
.win-btn-close.active {
    background: var(--success-gradient) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-delete {
    padding: 0.5rem 1rem;
    background: var(--secondary-gradient);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-delete:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

/* Chart Styles */
.chart-container {
    position: relative;
    height: 400px;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

#meteo .chart-container,
#root-zone .chart-container {
    height: 460px;
    padding: 10px 12px 4px;
}

.tracker-chart-note {
    margin: 6px 0 16px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

#tracker .chart-container {
    height: 800px;
}

/* Table Styles */
.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.data-count {
    padding: 0.5rem 1rem;
    background: var(--success-gradient);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

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

thead {
    background: rgba(255, 255, 255, 0.05);
}

th {
    padding: 0.7rem 0.8rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 0.65rem 0.8rem;
    color: var(--text-primary);
}

.data-table th,
.data-table td,
.table-v2 th,
.table-v2 td,
#dataTable th,
#dataTable td,
.mc-period-table th,
.mc-period-table td {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.empty-state td {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

.footer-content p {
    margin-bottom: 4px;
}

.footer-content p:last-child {
    margin-bottom: 0;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

html {
    font-size: 112.5%;
    /* Increase base font size to ~18px */
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-sm);
        padding-top: 90px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .card {
        padding: var(--spacing-md);
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .production-form {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 300px;
    }

    #meteo .chart-container,
    #root-zone .chart-container {
        height: 360px;
        padding: 10px 10px 4px;
    }

    #tracker .chart-container {
        height: 520px;
    }

    .sensor-mini-card {
        padding: var(--spacing-sm);
    }

    .sensor-value {
        font-size: 1.1rem;
    }

    th,
    td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tomato-icon {
        font-size: 2.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .data-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
}

/* General Card Style */
.card {
    background: rgba(20, 20, 35, 0.85);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

/* Meteo Section Styles */
.integrated-sensor-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.sensor-section-header {
    margin-bottom: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sensor-section-header h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.sensor-grid-mini {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.external-weather {
    display: flex;
    flex-direction: column;
}

.header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-icon-only {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.2s;
    padding: 0;
}

.btn-icon-only:hover {
    transform: scale(1.2);
}

.external-weather-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    flex-grow: 1;
}

.ext-item {
    background: rgba(255, 255, 255, 0.03);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.ext-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.ext-icon {
    font-size: 1.4rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ext-content {
    display: flex;
    flex-direction: column;
}

.ext-item.full-row {
    grid-column: span 2;
    padding: var(--spacing-md);
}

.ext-val-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-progress-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.mini-progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.5s ease;
}

.ext-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.ext-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.weather-footer {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
}

@media (max-width: 1100px) {
    .integrated-sensor-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {

    .sensor-grid-mini,
    .external-weather-grid {
        grid-template-columns: 1fr;
    }

    .ext-item.full-row {
        grid-column: span 1;
    }

    .sensor-mini-card {
        padding: var(--spacing-sm) var(--spacing-md) !important;
    }

    .ext-item {
        padding: var(--spacing-md) !important;
        gap: 20px;
    }

    .ext-icon {
        font-size: 2.8rem;
        width: 60px;
        height: 60px;
    }

    .ext-label {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .ext-value {
        font-size: 1.3rem;
    }

    .integrated-sensor-layout {
        gap: var(--spacing-md);
    }
}

.sensor-mini-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    margin-bottom: 0 !important;
}

.sensor-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.sensor-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.sensor-text h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.sensor-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.sensor-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.meteo-analysis-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
    align-items: stretch;
}

@media (max-width: 1100px) {
    .meteo-analysis-layout {
        grid-template-columns: 1fr;
    }
}

.meteo-analysis-layout>.card {
    min-width: 0;
    height: 100%;
    /* Ensure card fills the grid cell height */
    display: flex;
    flex-direction: column;
}

.meteo-chart-card {
    margin-bottom: 0 !important;
}

.chart-container {
    position: relative;
}

.chart-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(2px);
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    z-index: 4;
    pointer-events: auto;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.sensor-selector {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.sensor-btn {
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sensor-btn.active {
    background: var(--primary-gradient);
    color: white;
}

.sensor-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.analysis-tool {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: 0 !important;
}

.analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-good {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.status-bad {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.analysis-summary p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.analysis-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
}

.stat-box {
    background: rgba(255, 255, 255, 0.03);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.stat-val {
    font-size: 0.9rem;
    font-weight: 600;
}

.full-width {
    width: 100%;
    margin-top: auto;
}

.clickable {
    cursor: pointer;
}

.service-card-hit {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: block;
}

#mcServiceCard {
    z-index: 40;
    pointer-events: auto;
}

.company-section {
    position: relative;
    z-index: 1;
}

.mc-iframe-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.mc-iframe-wrap {
    padding: 0;
    overflow: hidden;
}

.mc-iframe {
    width: 100%;
    height: 82vh;
    min-height: 760px;
    border: 0;
    display: block;
    background: #0f172a;
}

@media (max-width: 768px) {
    .mc-iframe {
        min-height: 900px;
        height: 88vh;
    }
}

/* Responsive adjustment for meteo layout */
@media (max-width: 992px) {
    .meteo-analysis-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .sensor-selector {
        width: 100%;
        overflow-x: auto;
    }
}

/* Login Section Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    width: 100%;
    max-width: 480px;
    padding: var(--spacing-xl);
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.login-header h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.8rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-social:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-social:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-social:disabled:hover {
    transform: none;
    box-shadow: var(--shadow-md);
}

.btn-naver {
    background: #03C75A;
    color: white;
}

.btn-kakao {
    background: #FEE500;
    color: #000000;
}

.btn-google {
    background: white;
    color: #444;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--spacing-lg) 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 10px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.forgot-password {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.forgot-password:hover {
    color: var(--text-primary);
}

.btn-secondary {
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.login-footer {
    text-align: center;
    margin-top: var(--spacing-lg);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

/* Signup Specific Styles */
.signup-card {
    max-width: 520px;
}

.signup-tabs {
    display: flex;
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

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

.signup-content.active {
    animation: fadeInDown 0.4s ease-out;
}

.social-signup-guide {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 1rem;
}

.vertical-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nav-link-internal {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.nav-link-internal:hover {
    text-decoration: underline;
}

/* Checkbox Style */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}


.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-container:hover input~.checkmark {
    background-color: rgba(255, 255, 255, 0.2);
}

.checkbox-container input:checked~.checkmark {
    background-color: #667eea;
    border-color: #667eea;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container a {
    color: #667eea;
    text-decoration: none;
}

.checkbox-container a:hover {
    text-decoration: underline;
}

/* My Page Styles */
.profile-card {
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin: 0 auto var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.profile-info {
    margin-bottom: var(--spacing-lg);
}

.profile-info h3 {
    font-size: 1.5rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.profile-email {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
}

.profile-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.join-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Consulting Section Styles */
.consulting-view {
    animation: fadeIn 0.3s ease;
}

.hidden {
    display: none;
}

.board-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-sm);
}

.search-bar {
    display: flex;
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.2rem;
    max-width: 400px;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    outline: none;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    padding: 0 0.5rem;
    cursor: pointer;
}

.board-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding-bottom: 80px;
    /* Space for Kakao Banner */
}

.post-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.post-item:hover {
    transform: translateY(-2px);
    border-color: #667eea;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xs);
}

.post-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.post-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.post-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-environment {
    background: rgba(79, 172, 254, 0.2);
    color: #4facfe;
}

.badge-crop {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-pest {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-system {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-other {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.status-badge {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.status-badge.answered {
    background: var(--success-gradient);
    color: white;
}

/* Detail View */
.btn-back {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
}

.post-detail-card {
    padding-bottom: 80px;
}

.post-header-detail {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.post-body {
    min-height: 200px;
    line-height: 1.8;
}

.post-image-area img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    max-height: 400px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.2);
}

.comments-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.comment-item {
    background: rgba(255, 255, 255, 0.02);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.comment-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.comment-form {
    display: flex;
    gap: var(--spacing-xs);
}

.comment-form input {
    flex: 1;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: white;
}

/* Write Form */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

textarea {
    width: 100%;
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: white;
    font-family: inherit;
    resize: vertical;
}

select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(30, 30, 47, 1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: white;
}

.file-upload-box {
    border: 2px dashed var(--border-color);
    padding: var(--spacing-lg);
    text-align: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.file-upload-box:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.file-upload-box input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Kakao Banner */
/* Kakao Banner */
.kakao-banner {
    position: fixed;
    bottom: 30px;
    right: 30px;
    left: auto;
    transform: none;
    width: auto;
    max-width: 110px;
    /* 축소 상태 */
    background: #FEE500;
    color: #3b1e1e;
    padding: 12px;
    border-radius: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(254, 229, 0, 0.4);
    z-index: 900;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.kakao-banner.expanded {
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    right: auto;
    width: 90%;
    max-width: 600px;
    padding: 1rem 1.5rem;
    justify-content: space-between;
}

.kakao-banner:hover {
    transform: translateY(-5px);
}

.kakao-banner.expanded:hover {
    transform: translateX(-50%) translateY(-5px);
}

.kakao-icon-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.kakao-mini-text {
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 5px;
    /* 아이콘 옆 배치 */
    white-space: nowrap;
}

/* 구조 변경함: 아이콘 옆에 텍스트? 아님 아래? 위 index.html은 div wrapper로 감쌌음. column 방향이면 margin-top */
/* 플로팅 버튼이랑 맞추려면... 플로팅은 옆으로(row) 했음. */
/* index.html을 보니 .kakao-icon-wrapper 안에 span 두개 있음. */
/* .floating-btn과 달리 .kakao-banner는 미니 텍스트를 아이콘 아래에 두는게 나을 수도? */
/* 하지만 플로팅과 통일성 위해 옆으로? */
/* 일단 wrapper가 있으니 자유로움. */

.kakao-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    width: 0;
    transition: opacity 0.2s;
    overflow: hidden;
}

.kakao-banner.expanded .kakao-content {
    opacity: 1;
    width: auto;
    margin-left: 15px;
}

.kakao-banner.expanded .kakao-mini-text {
    display: none;
}

.kakao-icon {
    font-size: 1.5rem;
}

.kakao-text {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
}

.kakao-text strong {
    font-size: 0.95rem;
}

.kakao-text span {
    font-size: 0.8rem;
    opacity: 0.8;
}

.kakao-arrow {
    font-weight: bold;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .board-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .kakao-banner {
        bottom: 80px;
        /* Above bottom nav on mobile if app-like, otherwise keeps it clear */
        width: 95%;
    }
}

/* Pest Map Section Styles */
.forecast-section {
    margin-bottom: var(--spacing-lg);
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.forecast-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    position: relative;
    overflow: hidden;
}

.forecast-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.forecast-card.risk-high::before {
    background: #ef4444;
}

.forecast-card.risk-medium::before {
    background: #f59e0b;
}

.forecast-card.risk-low::before {
    background: #10b981;
}

.forecast-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forecast-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-good {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.map-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
    min-height: 500px;
}

.map-container-wrapper {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.pest-map {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-sm);
    z-index: 10;
}

.map-legend {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot.risk-high {
    background: #ef4444;
    box-shadow: 0 0 5px #ef4444;
}

.dot.risk-medium {
    background: #f59e0b;
    box-shadow: 0 0 5px #f59e0b;
}

.dot.shop-marker {
    background: #3b82f6;
    border: 2px solid white;
}

.diagnosis-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.diagnosis-card {
    padding: var(--spacing-lg);
}

.small-upload {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.shop-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.shop-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    animation: fadeIn 0.4s ease;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shop-name {
    font-weight: 700;
    color: var(--text-primary);
}

.shop-dist {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.shop-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    /* Added to fix potential line-clamp lint error for descriptions */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    /* Limit to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .map-layout {
        grid-template-columns: 1fr;
    }

    .pest-map {
        height: 300px;
    }
}

/* AI Prediction Section */
.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.prediction-form-grid {
    background: rgba(255, 255, 255, 0.02);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.prediction-form-grid input,
.prediction-form-grid select {
    background: #ffffff;
    color: #111827;
    border-color: #cbd5e1;
}

.prediction-form-grid input::placeholder {
    color: #94a3b8;
}

.prediction-form-grid input:focus,
.prediction-form-grid select:focus {
    background: #ffffff;
    color: #111827;
}

.form-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.prediction-results-area {
    margin-top: var(--spacing-lg);
    animation: fadeInUp 0.5s ease;
}

.result-display-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.prediction-period-block + .prediction-period-block {
    margin-top: var(--spacing-md);
}

.prediction-period-title {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #e2e8f0;
}

.result-mini-card {
    background: var(--primary-gradient);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.result-label {
    font-size: 0.9rem;
    opacity: 0.8;
    color: white;
}

.prediction-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.prediction-meta-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
}

.prediction-meta-val {
    margin-top: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #f8fafc;
}

.result-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
}

.ai-insight-box {
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    padding: var(--spacing-md);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.ai-insight-box strong {
    display: block;
    margin-bottom: 8px;
    color: #667eea;
}

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

    .prediction-meta-grid {
        grid-template-columns: 1fr;
    }

    #tracker .main-content {
        padding: 0 var(--spacing-md);
    }

    #tracker .header {
        padding: 0 var(--spacing-md);
    }
}

/* Company Section */
.company-section {
    margin-top: var(--spacing-xl);
}

.company-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.company-info .section-title {
    margin-bottom: var(--spacing-lg);
    font-size: 1.8rem;
}

.info-item {
    margin-bottom: var(--spacing-md);
}

.info-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.info-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.info-text a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.info-text a:hover {
    color: #667eea;
}

.company-map-container {
    height: 400px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.company-map {
    width: 100%;
    height: 100%;
}

#env-control .env-control-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

@media (max-width: 900px) {
    .company-layout {
        grid-template-columns: 1fr;
    }

    .company-map-container {
        height: 300px;
    }
}

@media (max-width: 768px) {
    #env-control .env-control-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    #env-control .env-control-grid .window-card,
    #env-control .env-control-grid .device-control-card {
        min-width: 0;
    }

    #env-control .env-control-grid .window-card h4,
    #env-control .env-control-grid .device-control-card h4 {
        font-size: 0.95rem !important;
    }
}

/* Image Preview Styles */
.image-preview-container {
    position: relative;
    margin-top: var(--spacing-sm);
    width: 100%;
    max-height: 250px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-preview-container.hidden {
    display: none;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
}

.btn-remove-preview {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(245, 87, 108, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, background 0.2s;
}

.btn-remove-preview:hover {
    transform: scale(1.1);
    background: #f5576c;
}

/* 게시글 수정/삭제 버튼 스타일 */
.post-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit,
.btn-delete {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-edit {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.btn-delete {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

/* iOS Input Zoom 방지 */
@media screen and (max-width: 768px) {

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* 목록으로 돌아가기 배너 버튼 */
.btn-back-banner {
    display: block;
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
    /* 렌더링 최적화 코드 제거 (맥북 크롬 충돌 방지) */
}

.btn-back-banner:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 모바일 글쓰기 취소 버튼 확대 */
@media screen and (max-width: 768px) {
    .btn-cancel {
        font-size: 1.1rem !important;
        padding: 0.8rem 1.2rem !important;
        background-color: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        color: #ff6b6b !important;
        font-weight: bold;
    }
}

/* 플로팅 상담 버튼 */
.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    max-width: 110px;
    /* 축소 상태 너비 (단톡방 텍스트 포함) */
}

.floating-mini-text {
    font-size: 0.9rem;
    font-weight: bold;
    margin-left: 8px;
    white-space: nowrap;
    opacity: 1;
}

.floating-btn.expanded .floating-mini-text {
    display: none;
}

.floating-btn.expanded {
    max-width: 300px;
    /* 확장 상태 너비 */
    padding: 12px 20px;
    border-radius: 20px;
}

.floating-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.floating-icon {
    font-size: 24px;
    min-width: 36px;
    text-align: center;
}

.floating-content {
    display: flex;
    flex-direction: column;
    margin-left: 10px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    width: 0;
    /* 축소 시 내용 숨김 */
}

.floating-btn.expanded .floating-content {
    opacity: 1;
    width: auto;
    margin-right: 15px;
}

.floating-title {
    font-weight: bold;
    font-size: 0.95rem;
}

.floating-desc {
    font-size: 0.8rem;
    opacity: 0.9;
}

.btn-close-floating {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0;
    width: 0;
    transition: opacity 0.2s;
}

.floating-btn.expanded .btn-close-floating {
    opacity: 0.8;
    width: auto;
}

.btn-close-floating:hover {
    opacity: 1;
}

/* 모바일 대응 */
@media screen and (max-width: 768px) {
    .floating-btn {
        bottom: 20px;
        right: 20px;
    }
}

/* 상세 페이지에서 헤더 숨김 */
.consulting-header-hidden {
    display: none !important;
}

/* 플로팅 버튼 숨김 (컨설팅 탭 진입 시) */
.floating-btn.hidden {
    display: none !important;
}

@media (min-width: 1024px) {
    #root-zone .sensor-grid-mini {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ----------------------------------------------------
   Crop Analysis Dashboard Styles (작물 분석)
   ---------------------------------------------------- */
.crop-dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: calc(100vh - 180px);
    /* Fill remaining height */
    min-height: 800px;
}

/* Common Card Style specific for this dashboard (Darker, thinner borders) */
.crop-dashboard-layout .card {
    background: #1e1e24;
    /* Slightly different dark */
    border: 1px solid #333;
    border-radius: 4px;
    /* Sharper corners for app-like feel */
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Left Panel: Camera */
.camera-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    background: #2a2a35;
    padding: 10px 15px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #e0e0e0;
    font-weight: 500;
}

.cam-controls .btn-icon {
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: #dbeafe;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 999px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cam-controls .btn-icon:hover,
.cam-controls .btn-icon.is-active {
    background: rgba(59, 130, 246, 0.28);
    border-color: rgba(147, 197, 253, 0.7);
    color: #ffffff;
}

.camera-view-container {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.thermal-feed {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.thermal-overlay-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: auto;
    cursor: crosshair;
    touch-action: none;
}

.visual-ruler-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: auto;
    cursor: crosshair;
    touch-action: none;
}

.thermal-point-marker {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.thermal-point-marker::before,
.thermal-point-marker::after {
    content: "";
    position: absolute;
    background: currentColor;
}

.thermal-point-marker::before {
    width: 2px;
    height: 22px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.thermal-point-marker::after {
    width: 22px;
    height: 2px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.thermal-box-marker {
    position: absolute;
    border: 2px solid currentColor;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.thermal-point-marker.editor-preview {
    color: #22d3ee !important;
    z-index: 8;
}

.thermal-box-marker.editor-preview {
    color: #22d3ee !important;
    border-style: dashed;
    background: rgba(34, 211, 238, 0.08);
    z-index: 7;
}

.thermal-item-label.editor-preview {
    background: rgba(8, 145, 178, 0.92);
    color: #ecfeff;
    z-index: 9;
}

.thermal-item-label {
    position: absolute;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    line-height: 1.2;
    font-weight: 700;
    color: #111827;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    pointer-events: none;
}

/* Camera Overlay UI */
.cam-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 10px;
    z-index: 3;
}

.cam-status {
    color: #f00;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    animation: blink 2s infinite;
}

.cam-time {
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    font-family: monospace;
}

.visual-ruler-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px 16px;
    background: #17171d;
    border-top: 1px solid #2b2b36;
}

.visual-ruler-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.visual-ruler-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

.visual-ruler-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 8px;
}

.visual-ruler-result,
.visual-ruler-hint {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #30303d;
    background: #111118;
    color: #d8dee9;
    line-height: 1.45;
}

.visual-ruler-result {
    font-weight: 700;
    color: #f8fafc;
}

.visual-ruler-result-group,
.visual-ruler-hint-group {
    grid-column: 1 / -1;
}

.visual-ruler-record-actions,
.visual-ruler-record-list-group {
    grid-column: 1 / -1;
}

.visual-ruler-record-actions {
    display: flex;
    justify-content: flex-end;
}

.visual-ruler-record-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
    overflow: auto;
}

.visual-ruler-record-card {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: #111118;
}

.visual-ruler-record-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.visual-ruler-record-title {
    font-weight: 700;
    color: #f8fafc;
}

.visual-ruler-record-length {
    font-weight: 700;
    color: #fb923c;
}

.visual-ruler-record-meta {
    font-size: 0.78rem;
    line-height: 1.5;
    color: #cbd5e1;
}

.visual-ruler-record-note {
    margin-top: 8px;
    color: #e2e8f0;
}

.visual-ruler-record-actions-row {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.visual-ruler-empty {
    padding: 14px 12px;
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.25);
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.35);
}

.visual-growth-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px 16px;
    background: #121218;
    border-top: 1px solid #2b2b36;
}

.visual-growth-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.visual-growth-header h4 {
    margin: 0;
    color: #f8fafc;
}

.visual-growth-header span {
    color: #94a3b8;
    font-size: 0.82rem;
}

.visual-growth-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.visual-growth-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

.visual-growth-hint-group,
.visual-growth-list-group {
    grid-column: 1 / -1;
}

.visual-growth-hint {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #30303d;
    background: #111118;
    color: #d8dee9;
    line-height: 1.45;
}

.visual-growth-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow: auto;
}

.visual-growth-card {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: #111118;
}

.visual-growth-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.visual-growth-card-title {
    font-weight: 700;
    color: #f8fafc;
}

.visual-growth-card-change {
    font-weight: 700;
    color: #22c55e;
}

.visual-growth-card-meta {
    font-size: 0.78rem;
    line-height: 1.5;
    color: #cbd5e1;
}

.visual-growth-card-note {
    margin-top: 8px;
    color: #e2e8f0;
}

.visual-growth-card-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.visual-growth-box {
    position: absolute;
    border: 2px solid #22c55e;
    background: rgba(34, 197, 94, 0.1);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.4);
    pointer-events: none;
}

.visual-growth-box.draft {
    border-style: dashed;
    background: rgba(59, 130, 246, 0.08);
}

.visual-growth-label {
    position: absolute;
    transform: translate(0, -120%);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    color: #052e16;
    background: rgba(134, 239, 172, 0.94);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.visual-ai-plan-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(180deg, #10131a 0%, #0f1411 100%);
    border-top: 1px solid #2b2b36;
}

.visual-ai-plan-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.visual-ai-plan-header h4 {
    margin: 0;
    color: #f8fafc;
}

.visual-ai-plan-header span {
    color: #86efac;
    font-size: 0.82rem;
}

.visual-ai-plan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.visual-ai-plan-card {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.72);
}

.visual-ai-plan-card strong {
    display: block;
    margin-bottom: 8px;
    color: #f8fafc;
}

.visual-ai-plan-card p {
    margin: 0;
    line-height: 1.55;
    color: #cbd5e1;
    font-size: 0.88rem;
}

.visual-ai-plan-card.accent {
    background: rgba(20, 83, 45, 0.42);
    border-color: rgba(74, 222, 128, 0.28);
}

.visual-ai-plan-data {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.5);
}

.visual-ai-plan-data-title {
    margin-bottom: 8px;
    font-weight: 700;
    color: #f8fafc;
}

.visual-ai-plan-data code {
    display: block;
    white-space: normal;
    word-break: break-word;
    color: #bfdbfe;
    line-height: 1.6;
}

.visual-annotation-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #101018;
    border-top: 1px solid #2b2b36;
}

.visual-annotation-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.visual-annotation-header h4 {
    margin: 0;
    color: #f8fafc;
}

.visual-annotation-header span {
    color: #fda4af;
    font-size: 0.82rem;
}

.visual-annotation-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.visual-annotation-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

.visual-annotation-hint-group,
.visual-annotation-list-group {
    grid-column: 1 / -1;
}

.visual-annotation-hint {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #30303d;
    background: #111118;
    color: #d8dee9;
    line-height: 1.45;
}

.visual-annotation-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow: auto;
}

.visual-annotation-card {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(251, 113, 133, 0.22);
    background: #111118;
}

.visual-annotation-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.visual-annotation-card-title {
    font-weight: 700;
    color: #f8fafc;
}

.visual-annotation-card-type {
    font-weight: 700;
    color: #fda4af;
}

.visual-annotation-card-status {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.16);
    color: #bfdbfe;
}

.visual-annotation-card-status.is-current {
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}

.visual-annotation-card-meta {
    font-size: 0.78rem;
    line-height: 1.5;
    color: #cbd5e1;
}

.visual-annotation-card-note {
    margin-top: 8px;
    color: #e2e8f0;
}

.visual-annotation-card-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.visual-annotation-box {
    position: absolute;
    border: 2px solid #fb7185;
    background: rgba(251, 113, 133, 0.1);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.35);
    pointer-events: none;
}

.visual-annotation-box.draft {
    border-style: dashed;
}

.visual-annotation-label {
    position: absolute;
    transform: translate(0, -120%);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    color: #4c0519;
    background: rgba(251, 191, 202, 0.96);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.visual-annotation-point {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    background: #fb7185;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.45);
    pointer-events: none;
}

.visual-annotation-polygon {
    fill: rgba(251, 113, 133, 0.12);
    stroke: #fb7185;
    stroke-width: 2;
    stroke-linejoin: round;
}

.visual-ruler-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.visual-ruler-reference-shape {
    fill: rgba(34, 211, 238, 0.12);
    stroke: #22d3ee;
    stroke-width: 2;
}

.visual-ruler-line {
    stroke: #f97316;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 10 7;
}

.visual-ruler-point {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
}

.visual-ruler-point.reference {
    background: #22d3ee;
}

.visual-ruler-point.measure {
    background: #f97316;
}

.visual-ruler-label {
    position: absolute;
    transform: translate(-50%, -120%);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.visual-ruler-label.reference {
    background: rgba(34, 211, 238, 0.92);
    color: #082f49;
}

.visual-ruler-label.measure {
    background: rgba(249, 115, 22, 0.94);
    color: #fff7ed;
}

@keyframes blink {
    50% {
        opacity: 0.5;
    }
}

/* Thermal Settings Panel */
.thermal-settings-panel {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #14141a;
    padding: 14px;
}

.thermal-settings-panel[hidden] {
    display: none !important;
}

.thermal-settings-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.thermal-settings-panel-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #f3f4f6;
}

.cam-tools {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    background: rgba(30, 30, 40, 0.82);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-tool {
    background: #444;
    border: 1px solid #555;
    color: white;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    text-align: center;
    transition: background 0.2s;
}

.btn-tool.ghost {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.35);
    color: #cbd5e1;
}

.btn-tool:hover {
    background: #555;
}

.btn-tool.primary {
    background: #3b82f6;
    border-color: #2563eb;
}

.btn-tool.danger {
    background: #ef4444;
    border-color: #dc2626;
}

.btn-tool.action {
    background: #10b981;
    border-color: #059669;
    font-weight: bold;
}

.tool-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    min-width: 0;
}

.tool-group label {
    font-size: 0.75rem;
    color: #ccc;
}

.tool-group select,
.tool-group input {
    background: #222;
    border: 1px solid #444;
    color: white;
    padding: 4px;
    font-size: 0.85rem;
    border-radius: 4px;
}

.thermal-editor-hint {
    max-width: 180px;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    padding: 8px 10px;
}

.cam-tools>.btn-tool,
.cam-tools>.tool-group {
    min-height: 100%;
}

.thermal-editor-hint-group {
    grid-column: 1 / -1;
}

/* Right Panel: Analysis */
.analysis-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.dashboard-top-bar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #1e1e24;
}

.indicators {
    display: flex;
    gap: 15px;
}

.indicator-tag {
    background: #3b82f6;
    color: white;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.9rem;
}

.gauge-section,
.realtime-chart-section {
    padding: 15px;
    background: #1e1e24;
}

.section-title-bar {
    background: #3b82f6;
    color: white;
    padding: 8px 12px;
    margin: -15px -15px 15px -15px;
    /* Pull to edges */
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title-bar h4 {
    margin: 0;
    font-size: 1rem;
}

.section-title-bar .indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.section-title-bar .indicator-tag {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
}

.target-select span {
    margin-left: 10px;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Gauges */
.gauge-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.gauge-item {
    background: #2a2a35;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #333;
}

.gauge-item h5 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #aaa;
    border-bottom: 2px solid #3b82f6;
    display: inline-block;
    padding-bottom: 2px;
}

.gauge-circle {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

/* Charts */
.chart-wrapper-small {
    height: 200px;
    width: 100%;
}

.chart-wrapper-medium {
    height: 300px;
    width: 100%;
}

.legend-checkboxes label {
    margin-left: 10px;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 1024px) {
    .crop-dashboard-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .camera-panel {
        height: 500px;
        /* Fixed height for camera on mobile */
    }
}

/* ----------------------------------------------------
   Crop Analysis Dashboard V2 Styles (Redesign)
   ---------------------------------------------------- */
.crop-dashboard-layout-v2 {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.crop-analysis-summary {
    background: #1e1e24;
    border: 1px solid #333;
    overflow: hidden;
}

/* Top Row: Camera + Side Info */
.crop-top-row {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(320px, 1fr);
    gap: 20px;
    align-items: start;
}

.crop-camera-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* Ensure Camera Panel fills height */
.crop-top-row .camera-panel {
    height: auto;
    align-self: start;
}

.camera-view-container {
    background: #000;
    aspect-ratio: 4 / 3;
    min-height: 0;
}

.visual-view-container {
    aspect-ratio: 16 / 9;
}

.visual-feed {
    object-fit: cover;
}

.thermal-side-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.thermal-item-panel {
    flex: 1;
    background: #17171d;
    padding: 12px 14px;
    overflow: auto;
}

@media (min-width: 1025px) {
    .crop-top-row {
        grid-template-columns: minmax(0, 2.6fr) minmax(360px, 1fr);
        row-gap: 20px;
    }

    .crop-camera-stack {
        display: contents;
    }

    .thermal-camera-panel {
        grid-column: 1 / -1;
    }

    .visual-camera-panel {
        grid-column: 1;
    }

    .thermal-side-panel {
        grid-column: 2;
        align-self: stretch;
    }

    .crop-top-row .camera-panel {
        min-height: 0;
    }

    .camera-view-container {
        min-height: 0;
    }

    .cam-tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .thermal-item-panel {
        min-height: 320px;
    }
}

.thermal-item-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.thermal-item-panel-header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.thermal-item-panel-header span {
    color: #a1a1aa;
    font-size: 0.8rem;
}

.thermal-item-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.thermal-item-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 12px;
}

.thermal-item-card h5 {
    margin: 0 0 6px;
    font-size: 0.88rem;
}

.thermal-item-card .thermal-item-value {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.thermal-item-card .thermal-item-meta {
    color: #cbd5e1;
    font-size: 0.75rem;
    line-height: 1.5;
}

.dashboard-top-bar {
    padding: 10px;
    background: #2a2a35;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dashboard-top-bar .indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.indicator-tag {
    font-size: 0.8rem;
    padding: 2px 6px;
}

.gauge-section-inner {
    display: flex;
    flex-direction: column;
    padding: 14px;
}

.gauge-grid-vertical {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.gauge-item {
    background: #25252e;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gauge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    border-bottom: 1px solid #444;
    padding-bottom: 3px;
}

.gauge-header h5 {
    margin: 0;
    font-size: 0.9rem;
    color: #ccc;
}

.gauge-header .gauge-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
}

.gauge-content-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.gauge-circle-small {
    width: 70px;
    height: 70px;
    position: relative;
    flex-shrink: 0;
}

.sparkline-container-small {
    flex: 1;
    height: 60px;
    background: #2a2a35;
    border-radius: 3px;
    border: 1px solid #333;
}

/* Bottom Row: Charts */
.crop-bottom-row {
    width: 100%;
}

#crop-analysis .main-content {
    padding-bottom: 12px;
}

#crop-analysis .crop-bottom-row {
    margin-bottom: 0;
}

#crop-analysis .crop-top-row {
    margin-bottom: 0;
}

.charts-container-row {
    display: flex;
    gap: 20px;
    padding: 15px;
}

.chart-wrapper-half {
    flex: 1;
    background: #25252e;
    padding: 10px;
    border-radius: 4px;
    height: 250px;
    /* Fixed height for bottom charts */
}

.chart-wrapper-half h5 {
    margin: 0 0 10px 0;
    color: #888;
    font-size: 0.85rem;
    text-transform: uppercase;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .crop-top-row {
        grid-template-columns: 1fr;
        height: auto;
    }

    .crop-camera-stack {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .camera-panel,
    .thermal-side-panel {
        height: auto;
        min-height: 400px;
    }

    .thermal-side-panel {
        max-height: none;
    }

    .charts-container-row {
        flex-direction: column;
    }

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

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

    .visual-ai-plan-grid {
        grid-template-columns: 1fr;
    }

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

    .gauge-grid-vertical {
        grid-template-columns: 1fr;
    }
}

/* Center gauge value inside circle */
.gauge-circle-small .gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 1.0rem;
    text-shadow: 1px 1px 2px #000;
}

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

    .dashboard-top-bar {
        align-items: flex-start;
    }

    .section-title-bar .indicators {
        flex-direction: column;
        align-items: stretch;
    }

    .charts-container-row {
        flex-direction: column;
        height: auto !important;
    }

    .chart-wrapper-half {
        width: 100% !important;
        height: 250px !important;
        flex: none !important;
        margin-bottom: 15px;
    }

    .thermal-item-list {
        grid-template-columns: 1fr;
    }

    .thermal-item-panel {
        max-height: 220px;
    }
}

/* Fix overflow for sparklines in gauge items */
.gauge-content-row {
    min-width: 0;
    /* Important for flex containers */
}

.sparkline-container-small {
    min-width: 0;
    /* Allow shrinking */
    overflow: hidden;
    /* Cut off excess */
    position: relative;
    /* For Chart.js */
}

.gauge-item {
    overflow: hidden;
    /* Prevent item overflow */
}

/* Tighten Layout (Reduce Margins) */
.crop-dashboard-layout-v2 {
    gap: 8px !important;
}

.crop-top-row {
    gap: 8px !important;
}

.gauge-section-inner {
    padding: 5px !important;
}

.dashboard-top-bar {
    padding: 5px 10px !important;
}

.gauge-item {
    margin-bottom: 0 !important;
    /* Remove any default margins */
}

.gauge-grid-vertical {
    gap: 5px !important;
}

/* Nutrient Controller (MC) */
.mc-tabs {
    display: inline-flex;
    gap: 8px;
    padding: 8px;
    margin-bottom: 16px;
}

.mc-tab-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
}

.mc-tab-btn.active {
    color: #fff;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.2);
}

.mc-monitor-ribbon {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.mc-ribbon-item {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.mc-ribbon-item span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.mc-ribbon-item strong {
    display: block;
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 800;
}

.mc-panel {
    display: none;
}

.mc-panel.active {
    display: block;
}

.mc-settings-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mc-settings-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    background: #eef3f9;
    color: #1e293b;
    border-color: rgba(148, 163, 184, 0.25);
}

.mc-settings-toolbar-left,
.mc-settings-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mc-settings-tab-ghosts {
    display: inline-flex;
    gap: 18px;
    padding: 0 4px;
}

.mc-settings-tab-ghosts span {
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 700;
    padding-bottom: 6px;
}

.mc-settings-tab-ghosts span.active {
    color: #2563eb;
    border-bottom: 3px solid #3b82f6;
}

.mc-process-pill {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    padding: 10px 14px;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
}

.mc-clock-box {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    padding: 8px 12px;
    min-width: 150px;
}

.mc-clock-box span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    margin-bottom: 2px;
}

.mc-clock-box strong {
    display: block;
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 700;
}

.mc-settings-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(420px, 1fr);
    gap: 18px;
    align-items: start;
}

.mc-settings-left,
.mc-settings-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.mc-settings-card {
    background: #f8fafc;
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.25);
    padding: 14px 16px;
}

.mc-settings-card h2 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #0f172a;
}

.mc-settings-info-grid,
.mc-settings-form-grid,
.mc-zone-toggle-grid,
.mc-settings-toggle-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mc-settings-form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mc-settings-info-grid > div,
.mc-settings-form-grid > div,
.mc-zone-toggle-grid > div,
.mc-settings-toggle-list > div {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    padding: 10px 12px;
}

.mc-settings-info-grid span,
.mc-settings-form-grid span,
.mc-zone-toggle-grid span,
.mc-settings-toggle-list span {
    display: block;
    color: #64748b;
    font-size: 0.76rem;
    margin-bottom: 4px;
}

.mc-settings-info-grid strong,
.mc-settings-form-grid strong,
.mc-zone-toggle-grid strong,
.mc-settings-toggle-list strong {
    display: block;
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 800;
}

.mc-period-card {
    background: #f8fafc;
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.25);
    padding: 14px 16px;
}

.mc-period-card h3 {
    margin: 0 0 12px;
    text-align: center;
    font-size: 1rem;
    color: #0f172a;
}

.mc-period-top {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.mc-period-top > div,
.mc-period-zone-row {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    padding: 8px 10px;
}

.mc-period-top span,
.mc-period-zone-row span,
.mc-period-zone-head span {
    color: #64748b;
    font-size: 0.76rem;
}

.mc-period-top strong,
.mc-period-zone-row strong {
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 800;
}

.mc-period-zone-head,
.mc-period-zone-row {
    display: grid;
    grid-template-columns: 108px 88px 1fr 1fr;
    gap: 8px;
    align-items: center;
}

.mc-period-zone-head {
    padding: 0 8px 6px;
}

.mc-period-zone-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mc-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.mc-monitor-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(480px, 2fr) minmax(320px, 1.1fr);
    gap: 16px;
    align-items: start;
}

.mc-monitor-left,
.mc-monitor-center,
.mc-monitor-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    height: 100%;
}

.mc-monitor-card {
    background: #f5f7fb;
    color: #1f2937;
    border-color: rgba(148, 163, 184, 0.25);
}

.mc-monitor-card .mc-panel-copy,
.mc-monitor-card .mc-panel-head h2,
.mc-monitor-card .mc-panel-head p,
.mc-monitor-card .mc-panel-head div,
.mc-monitor-card .mc-side-box-title {
    color: #1f2937;
}

.mc-monitor-card .mc-panel-copy {
    color: #64748b;
}

.mc-measure-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.mc-measure-table > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 78px;
    padding: 12px 14px;
    border-right: 1px solid #e5edf5;
    border-bottom: 1px solid #e5edf5;
    text-align: center;
}

.mc-measure-table > div:nth-child(2n) {
    border-right: none;
}

.mc-measure-table > div:nth-last-child(-n+2) {
    border-bottom: none;
}

.mc-measure-table span {
    color: #64748b;
    font-size: 0.84rem;
    margin-bottom: 6px;
}

.mc-measure-table strong {
    color: #111827;
    font-size: 1.3rem;
    font-weight: 800;
}

.mc-runtime-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #bfdbfe;
    margin-top: auto;
}

.mc-runtime-card.is-running {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.12);
}

.mc-runtime-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.mc-runtime-head h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1.05rem;
}

.mc-runtime-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
}

.mc-runtime-card.is-running .mc-runtime-badge {
    background: rgba(37, 99, 235, 0.14);
    color: #2563eb;
}

.mc-runtime-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mc-runtime-block {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    padding: 12px 14px;
}

.mc-runtime-block.ec {
    border-left: 4px solid #ef4444;
}

.mc-runtime-block.ph {
    border-left: 4px solid #22c55e;
}

.mc-runtime-block h4 {
    margin: 0 0 10px;
    font-size: 0.98rem;
    color: #0f172a;
}

.mc-runtime-block > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
}

.mc-runtime-block span {
    color: #64748b;
    font-size: 0.82rem;
}

.mc-runtime-block strong {
    color: #111827;
    font-size: 0.94rem;
    font-weight: 700;
}

.mc-chart-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.mc-chart-summary-item {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    padding: 10px 12px;
}

.mc-chart-summary-item span {
    display: block;
    color: #64748b;
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.mc-chart-summary-item strong {
    color: #111827;
    font-size: 1rem;
    font-weight: 800;
}

.mc-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.mc-legend-chip {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.82rem;
    cursor: pointer;
}

.mc-legend-chip.active {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.mc-chart-wrap {
    height: 470px;
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    padding: 12px;
}

.mc-side-box-title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.mc-side-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mc-side-kpi-grid > div,
.mc-device-meta .mc-meta-grid > div {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    padding: 10px 12px;
}

.mc-side-kpi-grid span,
.mc-device-meta .mc-meta-grid span {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.mc-side-kpi-grid strong,
.mc-device-meta .mc-meta-grid strong {
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 800;
}

.mc-zone-table-wrap {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    overflow: hidden;
}

.mc-device-meta {
    margin-top: auto;
}

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

.mc-zone-table th {
    background: #eff6ff;
    color: #475569;
    font-size: 0.7rem;
    padding: 0.5rem 0.35rem;
    text-transform: none;
    white-space: nowrap;
}

.mc-zone-table td {
    color: #111827;
    font-size: 0.74rem;
    padding: 0.5rem 0.35rem;
    border-top: 1px solid #e5edf5;
    white-space: nowrap;
    text-align: center;
}

.mc-zone-table td:first-child,
.mc-zone-table th:first-child {
    text-align: left;
}

.mc-zone-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 66px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.mc-zone-status.running {
    background: rgba(37, 99, 235, 0.14);
    color: #2563eb;
}

.mc-zone-status.finish {
    background: rgba(22, 163, 74, 0.14);
    color: #15803d;
}

.mc-zone-status.notuse {
    background: rgba(148, 163, 184, 0.16);
    color: #64748b;
}

.mc-monitor-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.btn-secondary.danger {
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(254, 226, 226, 0.7);
}

.mc-history-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.mc-history-list {
    flex: 1 1 auto;
    min-height: 340px;
    overflow: auto;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #fff;
}

.mc-history-row {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #e5edf5;
}

.mc-history-row:first-child {
    border-top: none;
}

.mc-history-index {
    color: #475569;
    font-weight: 700;
    font-size: 0.8rem;
}

.mc-history-time {
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 600;
}

.mc-history-type {
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 700;
}

.mc-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mc-status-grid>div {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.mc-kpi {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.mc-kpi div {
    display: flex;
    justify-content: space-between;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
}

.mc-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.mc-panel-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.mc-panel-copy {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.mc-bridge-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    font-size: 0.85rem;
    font-weight: 800;
    white-space: nowrap;
}

#mcBridgeStatusSide {
    color: #b91c1c !important;
    font-weight: 800;
}

.mc-setting-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mc-setting-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-secondary);
}

.mc-setting-grid input,
.mc-setting-grid select,
.mc-period-table input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 8px;
}

.mc-period-table-wrap {
    overflow-x: auto;
}

.mc-period-table td {
    min-width: 90px;
}

.mc-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.mc-status-grid>div span,
.mc-kpi div span,
.mc-meta-grid div span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 6px;
}

.mc-status-grid>div strong,
.mc-kpi div strong,
.mc-meta-grid div strong {
    display: block;
    font-size: 1.15rem;
    color: var(--text-primary);
}

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

.mc-meta-grid>div {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.mc-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mc-action-grid .btn-primary,
.mc-action-grid .btn-secondary {
    width: 100%;
    min-height: 52px;
    font-weight: 700;
}

.mc-state-note,
.mc-form-note {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.18);
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 900px) {
    .mc-grid {
        grid-template-columns: 1fr;
    }

    .mc-settings-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .mc-settings-layout {
        grid-template-columns: 1fr;
    }

    .mc-settings-info-grid,
    .mc-settings-form-grid,
    .mc-zone-toggle-grid,
    .mc-settings-toggle-list,
    .mc-period-top {
        grid-template-columns: 1fr;
    }

    .mc-period-zone-head,
    .mc-period-zone-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mc-monitor-ribbon {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

.mc-monitor-layout {
    grid-template-columns: 1fr;
}

    .mc-runtime-columns,
    .mc-chart-summary,
    .mc-side-kpi-grid,
    .mc-monitor-actions {
        grid-template-columns: 1fr;
    }

    .mc-setting-grid {
        grid-template-columns: 1fr;
    }

    .mc-meta-grid,
    .mc-action-grid {
        grid-template-columns: 1fr;
    }

    .mc-panel-head {
        flex-direction: column;
    }
}

.nursery-header {
    gap: 14px;
}

.nursery-topline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.nursery-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
}

.nursery-pill strong {
    color: #0f172a;
}

.nursery-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.nursery-ribbon {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.nursery-ribbon-card {
    background: linear-gradient(180deg, #f9fbff 0%, #eef4ff 100%);
    border: 1px solid rgba(59, 130, 246, 0.16);
    padding: 18px 20px;
}

.nursery-ribbon-label {
    display: block;
    color: #64748b;
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.nursery-ribbon-card strong {
    display: block;
    font-size: 1.8rem;
    line-height: 1.1;
    color: #0f172a;
}

.nursery-ribbon-card small {
    display: block;
    margin-top: 8px;
    color: #475569;
}

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

.nursery-panel {
    background: #f8fbff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nursery-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.nursery-panel-head h3 {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 1.08rem;
}

.nursery-panel-head p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.nursery-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.nursery-status-badge.led {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.nursery-status-badge.nutrient {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.nursery-status-badge.air {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

.nursery-panel-metric {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #dbe4f0;
}

.nursery-panel-metric span {
    color: #64748b;
    font-size: 0.92rem;
}

.nursery-panel-metric strong {
    color: #0f172a;
    font-size: 1.4rem;
    font-weight: 800;
}

.nursery-progress-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nursery-progress-labels {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #64748b;
    font-size: 0.88rem;
}

.nursery-progress-labels strong {
    color: #0f172a;
}

.nursery-progress-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5edf5;
}

.nursery-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    transition: width 0.35s ease;
}

.nursery-progress-fill.led {
    background: linear-gradient(90deg, #f59e0b 0%, #facc15 100%);
}

.nursery-progress-fill.air {
    background: linear-gradient(90deg, #38bdf8 0%, #2563eb 100%);
}

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

.nursery-kv-grid > div,
.nursery-stat-box {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    padding: 12px 14px;
}

.nursery-kv-grid span,
.nursery-stat-box span {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.nursery-kv-grid strong,
.nursery-stat-box strong {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
}

.nursery-dual-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.nursery-message {
    padding: 14px 16px;
    border-radius: 14px;
    background: #eaf3ff;
    color: #1e3a8a;
    font-weight: 700;
    line-height: 1.5;
}

.nursery-lower-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 16px;
}

.nursery-stage-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.nursery-stage-item {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid #dbe4f0;
    background: #f8fafc;
}

.nursery-stage-item.active {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.12);
}

.nursery-stage-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.nursery-stage-item strong {
    display: block;
    color: #0f172a;
    margin-bottom: 8px;
    font-size: 1rem;
}

.nursery-stage-item p {
    margin: 0;
    color: #64748b;
    line-height: 1.5;
    font-size: 0.88rem;
}

.nursery-action-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nursery-action-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #dbe4f0;
}

.nursery-action-item span {
    color: #64748b;
    font-size: 0.88rem;
}

.nursery-action-item strong {
    color: #0f172a;
    font-size: 0.96rem;
    text-align: right;
}

.nursery-action-item.emphasis {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    border-color: transparent;
}

.nursery-action-item.emphasis span,
.nursery-action-item.emphasis strong {
    color: #fff;
}

.nursery-inline-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
}

.nursery-inline-badge.info {
    background: #ecfeff;
    color: #0f766e;
}

@media (max-width: 1024px) {
    .nursery-ribbon,
    .nursery-main-grid,
    .nursery-lower-grid,
    .nursery-stage-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nursery-ribbon,
    .nursery-main-grid,
    .nursery-lower-grid,
    .nursery-stage-grid,
    .nursery-kv-grid,
    .nursery-dual-metrics {
        grid-template-columns: 1fr;
    }

    .nursery-panel-head,
    .nursery-panel-metric,
    .nursery-progress-labels,
    .nursery-action-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

.nursery-academic-header {
    gap: 14px;
}

.nursery-academic-topline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nursery-academic-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
    font-size: 0.88rem;
    font-weight: 700;
}

.nursery-academic-pill strong {
    color: #0f172a;
}

.nursery-academic-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nursery-academic-ribbon {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.nursery-academic-stat {
    background: linear-gradient(180deg, #f9fbff 0%, #eef4ff 100%);
    border: 1px solid rgba(59, 130, 246, 0.14);
    padding: 18px 20px;
}

.nursery-stat-label {
    display: block;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 0.82rem;
}

.nursery-academic-stat strong {
    display: block;
    font-size: 1.75rem;
    line-height: 1.1;
    color: #0f172a;
}

.nursery-academic-stat small {
    display: block;
    margin-top: 8px;
    color: #475569;
}

.nursery-academic-main {
    display: grid;
    grid-template-columns: 1.05fr 1.15fr 1fr;
    gap: 16px;
    align-items: start;
}

.nursery-config-card,
.nursery-target-card,
.nursery-live-card,
.nursery-lifecycle-card,
.nursery-action-card {
    background: #f8fbff;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.nursery-card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.nursery-card-head h3 {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 1.08rem;
}

.nursery-card-head p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.nursery-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.nursery-chip.accent {
    background: #dbeafe;
    color: #1d4ed8;
}

.nursery-chip.success {
    background: #dcfce7;
    color: #166534;
}

.nursery-form-grid,
.nursery-summary-grid,
.nursery-live-grid,
.nursery-energy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.nursery-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nursery-field span {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
}

.nursery-field input,
.nursery-field select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    font-size: 0.95rem;
}

.nursery-summary-box,
.nursery-target-item,
.nursery-live-box,
.nursery-energy-box {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    padding: 12px 14px;
}

.nursery-summary-box span,
.nursery-target-item span,
.nursery-live-box span,
.nursery-energy-box span {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.nursery-summary-box strong,
.nursery-target-item strong,
.nursery-live-box strong,
.nursery-energy-box strong {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
}

.nursery-platform-note {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #fff;
}

.nursery-platform-note strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.92rem;
}

.nursery-platform-note p {
    margin: 0;
    line-height: 1.6;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.nursery-structure-card {
    margin-top: 16px;
    padding: 16px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #dbe4f0;
}

.nursery-structure-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.nursery-structure-head h4 {
    margin: 0 0 6px;
    color: #0f172a;
}

.nursery-structure-head p {
    margin: 0;
    color: #64748b;
    line-height: 1.5;
    font-size: 0.88rem;
}

.nursery-structure-controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.nursery-stepper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nursery-stepper > span {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
}

.nursery-stepper-controls {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    gap: 8px;
}

.nursery-stepper-controls.single {
    grid-template-columns: 1fr;
}

.nursery-stepper-controls input,
.nursery-stepper-controls select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    text-align: center;
    font-weight: 700;
    color: #0f172a;
}

.nursery-step-btn {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
}

.nursery-structure-preview {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 0.9fr);
    gap: 16px;
    align-items: center;
}

.nursery-container-model {
    min-height: 380px;
    padding: 20px;
    border-radius: 18px;
    background: linear-gradient(180deg, #eaf2ff 0%, #dbeafe 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.nursery-model-wide-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}

.nursery-structure-card .nursery-container-model {
    min-height: 520px;
}

.nursery-container-shell {
    width: 100%;
    max-width: 440px;
    min-height: 320px;
    padding: 18px 16px;
    border-radius: 24px;
    background: linear-gradient(180deg, #1f2937 0%, #334155 100%);
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08), 0 20px 40px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nursery-container-shell.multi {
    flex: 0 0 auto;
}

.nursery-cad-shell {
    max-width: 560px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

.nursery-model-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255,255,255,0.9);
    font-size: 0.78rem;
    font-weight: 700;
}

.nursery-model-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
}

.nursery-cad-scene {
    position: relative;
    height: calc(var(--cad-h) + 70px);
    min-height: 360px;
}

.nursery-cad-box {
    position: absolute;
    left: 44px;
    bottom: 24px;
    width: var(--cad-w);
    height: var(--cad-h);
}

.nursery-cad-frontface,
.nursery-cad-topface,
.nursery-cad-sideface {
    position: absolute;
    border-radius: 10px;
    border: 1px solid rgba(147, 197, 253, 0.5);
}

.nursery-cad-frontface {
    inset: 0;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.02) 100%);
    overflow: hidden;
}

.nursery-cad-topface {
    left: 0;
    bottom: 100%;
    width: 100%;
    height: var(--cad-d);
    transform: skewX(-45deg);
    transform-origin: bottom left;
    background: rgba(96, 165, 250, 0.08);
}

.nursery-cad-sideface {
    left: 100%;
    bottom: 0;
    width: var(--cad-d);
    height: 100%;
    transform: skewY(-45deg);
    transform-origin: bottom left;
    background: rgba(96, 165, 250, 0.05);
}

.nursery-cad-axis {
    position: absolute;
    color: #bfdbfe;
    font-size: 0.76rem;
    font-weight: 700;
}

.nursery-cad-axis::before {
    content: '';
    position: absolute;
    background: rgba(191, 219, 254, 0.65);
}

.nursery-cad-axis.axis-x {
    left: 50px;
    bottom: 4px;
}

.nursery-cad-axis.axis-x::before {
    left: 22px;
    top: 50%;
    width: calc(var(--cad-w) - 26px);
    height: 2px;
}

.nursery-cad-axis.axis-y {
    left: calc(44px + var(--cad-w) + 10px);
    bottom: calc(24px + var(--cad-h) - 18px);
}

.nursery-cad-axis.axis-y::before {
    left: -10px;
    top: 50%;
    width: var(--cad-d);
    height: 2px;
    transform: rotate(-45deg);
    transform-origin: left center;
}

.nursery-cad-axis.axis-z {
    left: 6px;
    bottom: 34px;
}

.nursery-cad-axis.axis-z::before {
    left: 12px;
    bottom: 20px;
    width: 2px;
    height: var(--cad-h);
}

.nursery-cad-rackline {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(191, 219, 254, 0.22);
}

.nursery-cad-rack-frame {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 2px solid rgba(226, 232, 240, 0.82);
    border-right: 2px solid rgba(226, 232, 240, 0.82);
    background: rgba(255,255,255,0.02);
}

.nursery-cad-rack-frame::before,
.nursery-cad-rack-frame::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(226, 232, 240, 0.82);
}

.nursery-cad-rack-frame::before {
    top: 0;
}

.nursery-cad-rack-frame::after {
    bottom: 0;
}

.nursery-cad-rack-shelf {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(226, 232, 240, 0.7);
}

.nursery-cad-tierline {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(34, 197, 94, 0.9);
}

.nursery-cad-tierlabel {
    position: absolute;
    left: 8px;
    bottom: 6px;
    color: #dcfce7;
    font-size: 0.7rem;
    font-weight: 800;
}

.nursery-cad-led-track {
    position: absolute;
    right: 8px;
    bottom: 6px;
    display: inline-flex;
    gap: 4px;
}

.nursery-cad-led-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #fde047;
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.65);
}

.nursery-cad-clearance {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    color: rgba(226, 232, 240, 0.92);
    background: rgba(15, 23, 42, 0.18);
}

.nursery-cad-clearance.bottom {
    bottom: 0;
    border-top: 1px dashed rgba(148, 163, 184, 0.45);
}

.nursery-cad-clearance.top {
    top: 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
}

.nursery-cad-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.nursery-viewer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.nursery-viewer-card {
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
}

.nursery-viewer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #dbeafe;
    font-size: 0.75rem;
}

.nursery-top-view,
.nursery-side-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.nursery-top-box,
.nursery-side-box {
    position: relative;
    width: 100%;
    height: 140px;
    border-radius: 12px;
    border: 1px solid rgba(147, 197, 253, 0.45);
    background: rgba(37, 99, 235, 0.06);
    overflow: hidden;
}

.nursery-top-box::before,
.nursery-side-box::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px dashed rgba(191, 219, 254, 0.18);
    border-radius: 12px;
}

.nursery-top-rack {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    box-shadow: 0 0 0 1px rgba(220, 252, 231, 0.22);
    color: #ecfdf5;
    font-size: 0.68rem;
    font-weight: 800;
}

.nursery-side-tier {
    position: absolute;
    left: 8%;
    right: 8%;
    height: 12px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.95);
}

.nursery-side-rack-frame {
    position: absolute;
    left: 14%;
    right: 20%;
    top: 0;
    bottom: 0;
    border: 2px solid rgba(226, 232, 240, 0.82);
    border-radius: 10px;
}

.nursery-side-rack-shelf {
    position: absolute;
    left: 14%;
    right: 20%;
    height: 2px;
    background: rgba(226, 232, 240, 0.7);
}

.nursery-side-tier i {
    position: absolute;
    right: -22px;
    top: -2px;
    font-style: normal;
    color: #dcfce7;
    font-size: 0.68rem;
    font-weight: 800;
}

.nursery-side-clearance {
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.16);
}

.nursery-side-clearance.bottom {
    bottom: 0;
    border-top: 1px dashed rgba(148, 163, 184, 0.45);
}

.nursery-side-clearance.top {
    top: 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
}

.nursery-cad-meta div {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nursery-cad-meta strong {
    color: rgba(191, 219, 254, 0.9);
    font-size: 0.75rem;
}

.nursery-cad-meta span {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.45;
}

.nursery-rack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    flex: 1 1 auto;
}

.nursery-rack-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
}

.nursery-rack-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255,255,255,0.84);
    font-size: 0.74rem;
    font-weight: 700;
}

.nursery-model-tier {
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 10px 12px;
}

.nursery-model-led {
    height: 10px;
    border-radius: 999px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #facc15 0%, #fde68a 100%);
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
}

.nursery-model-led-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}

.nursery-model-led-group .nursery-model-led {
    margin-bottom: 0;
    min-width: 18px;
}

.nursery-model-led.off {
    background: rgba(148, 163, 184, 0.22);
    box-shadow: none;
}

.nursery-model-bed {
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(180deg, #16a34a 0%, #166534 100%);
    position: relative;
    overflow: hidden;
}

.nursery-model-bed::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, rgba(255,255,255,0.12) 0 6px, transparent 6px 18px);
}

.nursery-model-tier-label {
    display: block;
    margin-top: 8px;
    color: rgba(255,255,255,0.72);
    font-size: 0.72rem;
    font-weight: 700;
}

.nursery-structure-summary {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fbff;
    color: #1e3a8a;
    border: 1px solid #dbeafe;
    line-height: 1.65;
    font-size: 0.88rem;
    font-weight: 600;
}

.nursery-flow-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.nursery-hvac-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}

.nursery-hvac-summary,
.nursery-hvac-scenarios {
    background: #fff;
    border: 1px solid #dbe4f0;
}

.nursery-hvac-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.nursery-hvac-metric {
    padding: 12px 14px;
    border-radius: 12px;
    background: #eff6ff;
}

.nursery-hvac-metric span {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.nursery-hvac-metric strong {
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 800;
}

.nursery-scenario-grid {
    display: grid;
    gap: 12px;
}

.nursery-scenario-card {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #dbe4f0;
    background: #f8fbff;
}

.nursery-scenario-card.best {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.12);
}

.nursery-scenario-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.nursery-scenario-head strong {
    color: #0f172a;
}

.nursery-scenario-head span {
    color: #1d4ed8;
    font-size: 0.74rem;
    font-weight: 800;
}

.nursery-scenario-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.nursery-scenario-body div {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.85);
}

.nursery-scenario-body span {
    display: block;
    color: #64748b;
    font-size: 0.76rem;
    margin-bottom: 5px;
}

.nursery-scenario-body strong {
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 800;
}

.nursery-scenario-card p {
    margin: 0;
    color: #475569;
    line-height: 1.5;
    font-size: 0.84rem;
}

.nursery-flow-card {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #dbe4f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.nursery-flow-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.nursery-flow-head h5 {
    margin: 0;
    color: #0f172a;
}

.nursery-flow-list {
    display: grid;
    gap: 10px;
}

.nursery-flow-list div {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #eff6ff;
}

.nursery-flow-list span {
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
}

.nursery-flow-list strong {
    color: #1e3a8a;
    font-size: 0.84rem;
    font-weight: 800;
    text-align: right;
    line-height: 1.4;
}

.nursery-live-box small,
.nursery-energy-box small {
    display: block;
    margin-top: 6px;
    color: #475569;
    line-height: 1.45;
}

.nursery-target-hero {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.nursery-reference-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.nursery-reference-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.76rem;
    font-weight: 700;
}

.nursery-stage-table {
    border-radius: 12px;
    border: 1px solid #dbe4f0;
    overflow: hidden;
    background: #fff;
}

.nursery-stage-table-head,
.nursery-stage-row {
    display: grid;
    grid-template-columns: 100px 90px 1.5fr 1.3fr;
    gap: 12px;
    padding: 12px 14px;
    align-items: start;
}

.nursery-stage-table-head {
    background: #eaf2ff;
    color: #1e3a8a;
    font-weight: 800;
    font-size: 0.82rem;
}

.nursery-stage-row {
    border-top: 1px solid #eef2f7;
    color: #334155;
    font-size: 0.86rem;
    line-height: 1.45;
}

.nursery-academic-lower {
    display: grid;
    grid-template-columns: 1.15fr 0.95fr;
    gap: 16px;
}

.nursery-stage-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.nursery-stage-progress-bar {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #dbe4f0;
    overflow: hidden;
}

.nursery-stage-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1d4ed8 0%, #60a5fa 100%);
    transition: width 0.35s ease;
}

.nursery-stage-progress-meta {
    display: flex;
    justify-content: space-between;
    color: #64748b;
    font-size: 0.85rem;
}

.nursery-stage-progress-meta strong {
    color: #0f172a;
}

.nursery-stage-card {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid #dbe4f0;
    background: #f8fafc;
}

.nursery-stage-card.active {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.12);
}

.nursery-stage-card-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-bottom: 12px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 800;
}

.nursery-stage-card strong {
    display: block;
    margin-bottom: 8px;
    color: #0f172a;
}

.nursery-stage-card p,
.nursery-stage-card small {
    display: block;
    margin: 0;
    color: #64748b;
    line-height: 1.45;
}

.nursery-guidance-note {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a8a;
    line-height: 1.55;
    font-size: 0.9rem;
    font-weight: 600;
}

.nursery-reference-footer {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.22);
    padding: 18px 20px;
}

.nursery-reference-footer h5 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 0.98rem;
}

.nursery-reference-footer p {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
    font-size: 0.9rem;
}

.nursery-reference-footer p + p {
    margin-top: 8px;
}

.nursery-rack-detail-card {
    margin-top: 16px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid #d9e6f5;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.nursery-rack-detail-view {
    display: grid;
    grid-template-columns: minmax(360px, 1.3fr) minmax(220px, 0.7fr);
    gap: 18px;
    align-items: stretch;
}

.nursery-rack-svg-stage {
    position: relative;
    width: 100%;
    height: 100%;
    transform: rotateX(var(--rack-rot-x, 5deg)) rotateY(var(--rack-rot-y, -18deg));
    transform-style: preserve-3d;
}

.nursery-rack-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.nursery-rack-svg-axis {
    fill: #1e3a8a;
    font-size: 16px;
    font-weight: 700;
}

.nursery-rack-svg-post,
.nursery-rack-svg-frame-beam,
.nursery-rack-svg-actuator-head,
.nursery-rack-svg-actuator-rod,
.nursery-rack-svg-base,
.nursery-rack-svg-top-frame,
.nursery-rack-svg-light-frame {
    stroke: rgba(90, 98, 110, 0.98);
    stroke-width: 3.4;
    fill: url(#rackMetal);
}

.nursery-rack-svg-post.front {
    stroke-width: 5;
}

.nursery-rack-svg-post.rear,
.nursery-rack-svg-frame-beam.dim {
    opacity: 0.72;
}

.nursery-rack-svg-base,
.nursery-rack-svg-top-frame {
    fill: rgba(240, 244, 249, 0.32);
}

.nursery-rack-svg-tray-top {
    fill: url(#rackTray);
    stroke: rgba(203, 213, 225, 0.9);
    stroke-width: 1.2;
}

.nursery-rack-svg-tray-front,
.nursery-rack-svg-tray-side {
    fill: rgba(226, 232, 240, 0.88);
    stroke: rgba(203, 213, 225, 0.8);
    stroke-width: 1.1;
}

.nursery-rack-svg-tier-label {
    fill: #1e3a8a;
    font-size: 15px;
    font-weight: 700;
}

.nursery-rack-svg-gapline {
    stroke: rgba(37, 99, 235, 0.42);
    stroke-width: 2;
    stroke-dasharray: 8 6;
}

.nursery-rack-svg-tier {
    cursor: pointer;
}

.nursery-rack-svg-tier:hover .nursery-rack-svg-tray-top {
    filter: brightness(1.02);
}

.nursery-rack-svg-tier.lights-off .nursery-rack-svg-tray-top {
    fill: #eef2f7;
}

.nursery-rack-svg-tube {
    stroke: #fffdf5;
    stroke-width: 9;
    stroke-linecap: round;
    filter: drop-shadow(0 0 10px rgba(255, 248, 196, 0.9));
}

.nursery-rack-svg-tube.off {
    stroke: #cbd5e1;
    filter: none;
    opacity: 0.55;
}

.nursery-rack-svg-wheel {
    fill: #d1d9e3;
    stroke: #64748b;
    stroke-width: 2;
    filter: drop-shadow(0 4px 6px rgba(15, 23, 42, 0.15));
}

.nursery-rack-svg-lift-frame.auto {
    animation: nurserySvgLightLift 5.8s ease-in-out infinite alternate;
}

.nursery-rack-svg-lift-frame.manual {
    animation: none;
}

.nursery-rack-detail-scene {
    position: relative;
    min-height: 620px;
    border-radius: 20px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 12%, rgba(255,255,255,0.98) 0%, rgba(244, 248, 255, 0.98) 36%, rgba(228, 237, 248, 0.98) 100%),
        repeating-linear-gradient(0deg, rgba(148,163,184,0.08) 0 1px, transparent 1px 48px),
        repeating-linear-gradient(90deg, rgba(148,163,184,0.08) 0 1px, transparent 1px 48px);
    border: 1px solid #d7e6f8;
    perspective: 1400px;
    cursor: grab;
    user-select: none;
}

.nursery-rack-3d-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    transform: rotateX(var(--rack-rot-x, 5deg)) rotateY(var(--rack-rot-y, -18deg));
    transform-style: preserve-3d;
}

.nursery-rack-floor {
    position: absolute;
    left: 8%;
    right: 12%;
    bottom: 10%;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #475569, #1e293b);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

.nursery-rack-post,
.nursery-rack-top-beam,
.nursery-rack-bottom-beam,
.nursery-rack-rail,
.nursery-rack-shelf-bar,
.nursery-rack-light-bar,
.nursery-rack-cylinder,
.nursery-rack-target-marker,
.nursery-rack-tier-deck,
.nursery-rack-wheel,
.nursery-rack-cylinder-head {
    position: absolute;
}

.nursery-rack-post {
    width: 6px;
    background: linear-gradient(90deg, #616c75 0%, #edf2f7 22%, #95a2ad 45%, #f8fafc 62%, #7a858e 100%);
    bottom: 10%;
    height: 76%;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.35), 0 8px 14px rgba(15, 23, 42, 0.12);
}

.nursery-rack-post.left.front {
    left: 15%;
}

.nursery-rack-post.right.front {
    right: 20%;
}

.nursery-rack-post.left.rear {
    left: 24%;
    height: 86%;
    bottom: 16%;
    opacity: 0.68;
}

.nursery-rack-post.right.rear {
    right: 10%;
    height: 86%;
    bottom: 16%;
    opacity: 0.68;
}

.nursery-rack-top-beam {
    height: 8px;
    background: linear-gradient(90deg, #6f7c85 0%, #edf2f7 28%, #9aa7b2 50%, #f8fafc 70%, #6f7c85 100%);
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.3);
}

.nursery-rack-top-beam.front {
    left: 15%;
    right: 20%;
    top: 20%;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.22);
}

.nursery-rack-top-beam.rear {
    left: 24%;
    right: 10%;
    top: 10%;
    opacity: 0.72;
}

.nursery-rack-top-beam.left-depth {
    left: 15.2%;
    top: 10.4%;
    width: 10%;
    transform: rotate(46deg);
    transform-origin: left center;
    opacity: 0.72;
}

.nursery-rack-top-beam.right-depth {
    right: 19.8%;
    top: 10.4%;
    width: 10%;
    transform: rotate(-46deg);
    transform-origin: right center;
    opacity: 0.72;
}

.nursery-rack-bottom-beam {
    left: 15%;
    right: 20%;
    bottom: 16%;
    height: 7px;
    background: linear-gradient(90deg, #6f7c85 0%, #edf2f7 28%, #9aa7b2 50%, #f8fafc 70%, #6f7c85 100%);
    border-radius: 3px;
}

.nursery-rack-bottom-beam.rear {
    left: 24%;
    right: 10%;
    bottom: 26%;
    opacity: 0.46;
}

.nursery-rack-rail {
    width: 3px;
    top: 20%;
    bottom: 16%;
    background: linear-gradient(180deg, #dbeafe 0%, #7dd3fc 50%, #dbeafe 100%);
    border-radius: 999px;
    opacity: 0.75;
}

.nursery-rack-rail.left {
    left: 30%;
}

.nursery-rack-rail.right {
    right: 24%;
}

.nursery-rack-cylinder {
    width: 12px;
    top: 8%;
    border-radius: 999px;
    background: linear-gradient(180deg, #64748b 0%, #e2e8f0 34%, #94a3b8 65%, #475569 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55);
}

.nursery-rack-cylinder.left {
    left: 28.8%;
}

.nursery-rack-cylinder.right {
    right: 22.8%;
}

.nursery-rack-cylinder-head {
    left: 47.8%;
    top: 4%;
    width: 10px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(180deg, #64748b 0%, #cbd5e1 58%, #94a3b8 100%);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.45);
}

.nursery-rack-cylinder-rod {
    left: 48.3%;
    top: 8%;
    width: 5px;
    border-radius: 999px;
    background: linear-gradient(180deg, #94a3b8 0%, #f8fafc 42%, #94a3b8 100%);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.32);
    z-index: 2;
}

.nursery-rack-shelf-bar {
    left: 17%;
    right: 22%;
    height: 7px;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(148,163,184,0.55) 0%, rgba(226,232,240,0.95) 50%, rgba(100,116,139,0.65) 100%);
    box-shadow: 0 6px 12px rgba(148, 163, 184, 0.14);
}

.nursery-rack-shelf-label {
    position: absolute;
    left: -54px;
    top: -9px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e3a8a;
}

.nursery-rack-target-marker {
    left: 68%;
    width: 16%;
    border-top: 1px dashed rgba(37, 99, 235, 0.35);
}

.nursery-rack-target-marker::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.45);
}

.nursery-rack-target-marker.active {
    border-top-color: rgba(249, 115, 22, 0.75);
}

.nursery-rack-target-marker.active::after {
    background: #f97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.18);
}

.nursery-rack-tier-deck {
    left: 19%;
    width: 52%;
    height: 74px;
    transform: translateY(50%);
    pointer-events: auto;
    cursor: pointer;
}

.nursery-rack-tier-deck:hover .nursery-rack-tier-plane {
    box-shadow: 0 18px 28px rgba(148, 163, 184, 0.24);
}

.nursery-rack-tier-deck.lights-off .nursery-rack-tier-plane {
    background: linear-gradient(180deg, rgba(248,250,252,0.98) 0%, rgba(226,232,240,0.98) 100%);
}

.nursery-rack-tier-plane,
.nursery-rack-tier-edge,
.nursery-rack-tier-support,
.nursery-rack-tier-bank {
    position: absolute;
}

.nursery-rack-tier-plane {
    left: 0;
    right: 0;
    top: 12px;
    height: 34px;
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(241, 245, 249, 0.98) 100%);
    border: 1px solid rgba(203, 213, 225, 0.9);
    box-shadow: 0 16px 22px rgba(148, 163, 184, 0.18);
}

.nursery-rack-tier-edge.front {
    left: 0;
    right: 0;
    top: 45px;
    height: 8px;
    background: linear-gradient(180deg, rgba(203,213,225,0.96) 0%, rgba(148,163,184,0.92) 100%);
    border-radius: 0 0 4px 4px;
}

.nursery-rack-tier-edge.side {
    top: 14px;
    right: -14px;
    width: 15px;
    height: 34px;
    background: linear-gradient(180deg, rgba(226,232,240,0.92) 0%, rgba(148,163,184,0.88) 100%);
    transform: skewY(42deg);
    transform-origin: left top;
    border-radius: 0 6px 6px 0;
}

.nursery-rack-tier-support {
    width: 3px;
    top: 46px;
    height: 20px;
    background: linear-gradient(180deg, rgba(148,163,184,0.88) 0%, rgba(71,85,105,0.92) 100%);
    border-radius: 999px;
}

.nursery-rack-tier-support.left {
    left: 12px;
}

.nursery-rack-tier-support.right {
    right: 22px;
}

.nursery-rack-tier-bank {
    left: 20px;
    right: 20px;
    top: -2px;
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.nursery-rack-bank-tube {
    width: 8%;
    min-width: 18px;
    height: 9px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255, 248, 196, 0.95) 55%, rgba(255,255,255,0.98) 100%);
    box-shadow:
        0 0 16px rgba(255, 244, 184, 0.6),
        0 0 3px rgba(148, 163, 184, 0.35);
}

.nursery-rack-bank-tube.off {
    background: linear-gradient(180deg, rgba(226,232,240,0.95) 0%, rgba(203,213,225,0.95) 55%, rgba(226,232,240,0.95) 100%);
    box-shadow: 0 0 2px rgba(148, 163, 184, 0.28);
    opacity: 0.55;
}

.nursery-rack-light-frame {
    position: absolute;
    left: 22%;
    right: 16%;
    height: 64px;
    transform: translateY(50%);
    filter: drop-shadow(0 16px 22px rgba(15, 23, 42, 0.14));
    transform-style: preserve-3d;
}

.nursery-rack-light-bar {
    position: absolute;
    left: 0;
    right: 0;
    height: 8px;
    border-radius: 3px;
    background: linear-gradient(90deg, #6f7c85 0%, #edf2f7 28%, #9aa7b2 50%, #f8fafc 70%, #6f7c85 100%);
    box-shadow: 0 0 0 1px rgba(203,213,225,0.85), 0 0 8px rgba(255,255,255,0.35);
}

.nursery-rack-light-bar.front {
    bottom: 6px;
}

.nursery-rack-light-bar.rear {
    top: 6px;
    left: 14px;
    right: -10px;
    opacity: 0.72;
}

.nursery-rack-light-bar.side-left {
    left: 6px;
    right: auto;
    top: 10px;
    width: 12px;
    height: 42px;
    transform: skewY(40deg);
    transform-origin: left top;
}

.nursery-rack-light-bar.side-right {
    right: 6px;
    top: 10px;
    width: 12px;
    height: 42px;
    left: auto;
    transform: skewY(-40deg);
    transform-origin: right top;
}

.nursery-rack-light-array {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.nursery-rack-light-dot {
    width: 42px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(255, 250, 220, 0.98) 58%, rgba(255,255,255,1) 100%);
    box-shadow:
        0 0 22px rgba(255, 248, 196, 0.75),
        0 0 4px rgba(148,163,184,0.4);
}

.nursery-rack-light-frame.auto {
    animation: nurseryLightLiftAuto 5.8s ease-in-out infinite alternate;
}

.nursery-rack-light-frame.manual {
    animation: none;
}

.nursery-rack-light-empty {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
}

.nursery-rack-light-lift-label {
    position: absolute;
    right: -6px;
    top: -22px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.86);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.nursery-rack-axis {
    position: absolute;
    font-size: 0.76rem;
    font-weight: 700;
    color: #1e3a8a;
}

.nursery-rack-axis.axis-x {
    left: 15%;
    bottom: 5%;
}

.nursery-rack-axis.axis-x::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 50%;
    width: 180px;
    height: 2px;
    background: rgba(30, 58, 138, 0.45);
}

.nursery-rack-axis.axis-z {
    left: 5%;
    bottom: 18%;
}

.nursery-rack-axis.axis-z::before {
    content: '';
    position: absolute;
    left: 16px;
    bottom: 18px;
    width: 2px;
    height: 200px;
    background: rgba(30, 58, 138, 0.45);
}

.nursery-rack-clearance {
    position: absolute;
    right: 4%;
    width: 72px;
    padding-right: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
    text-align: right;
}

.nursery-rack-clearance::before {
    content: '';
    position: absolute;
    left: -80px;
    right: 0;
    top: 50%;
    border-top: 1px dashed rgba(100, 116, 139, 0.45);
}

.nursery-rack-clearance.bottom {
    bottom: 10%;
}

.nursery-rack-clearance.top {
    top: 7%;
}

.nursery-rack-wheel {
    width: 18px;
    height: 18px;
    bottom: 7.2%;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 35%, #f8fafc 0%, #94a3b8 42%, #334155 100%);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.75), 0 2px 8px rgba(15, 23, 42, 0.18);
}

@keyframes nurseryLightLiftAuto {
    0% {
        transform: translateY(50%) translateZ(0);
    }
    100% {
        transform: translateY(calc(50% - var(--lift-travel, 10%))) translateZ(0);
    }
}

@keyframes nurserySvgLightLift {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(calc(-1 * var(--lift-travel-px, 40px)));
    }
}

.nursery-rack-wheel.left-front {
    left: 13.8%;
}

.nursery-rack-wheel.right-front {
    right: 18.8%;
}

.nursery-rack-wheel.left-rear {
    left: 23.2%;
    bottom: 13.2%;
    opacity: 0.7;
}

.nursery-rack-wheel.right-rear {
    right: 8.6%;
    bottom: 13.2%;
    opacity: 0.7;
}

.nursery-rack-detail-scene:active {
    cursor: grabbing;
}

.nursery-rack-detail-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.nursery-rack-detail-meta div {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #d9e6f5;
    background: rgba(255,255,255,0.82);
}

.nursery-rack-detail-meta strong {
    display: block;
    margin-bottom: 6px;
    color: #1e3a8a;
    font-size: 0.78rem;
}

.nursery-rack-detail-meta span {
    color: #0f172a;
    font-weight: 700;
    line-height: 1.45;
}

@media (max-width: 1200px) {
    .nursery-academic-main,
    .nursery-academic-lower,
    .nursery-academic-ribbon {
        grid-template-columns: 1fr 1fr;
    }

    .nursery-target-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .nursery-academic-ribbon,
    .nursery-academic-main,
    .nursery-academic-lower,
    .nursery-form-grid,
    .nursery-summary-grid,
    .nursery-live-grid,
    .nursery-energy-grid,
    .nursery-target-hero,
    .nursery-stage-grid {
        grid-template-columns: 1fr;
    }

    .nursery-stage-table-head,
    .nursery-stage-row {
        grid-template-columns: 1fr;
    }

    .nursery-card-head,
    .nursery-stage-progress-meta,
    .nursery-structure-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .nursery-structure-controls,
    .nursery-structure-preview,
    .nursery-model-wide-layout,
    .nursery-rack-detail-view {
        grid-template-columns: 1fr;
    }

    .nursery-cad-meta {
        grid-template-columns: 1fr;
    }

    .nursery-viewer-grid {
        grid-template-columns: 1fr;
    }

    .nursery-flow-grid {
        grid-template-columns: 1fr;
    }

    .nursery-hvac-grid,
    .nursery-hvac-metrics,
    .nursery-scenario-body {
        grid-template-columns: 1fr;
    }
}

#mypage .auth-container {
    width: min(100%, 880px);
    margin: 0 auto;
    padding: 0 24px 40px;
    box-sizing: border-box;
}

#mypage .header {
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}

#mypage .header-content {
    width: min(100%, 880px);
    margin: 0 auto 24px;
    box-sizing: border-box;
}

#mypage .auth-form-container {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
}

#mypage .auth-form {
    width: 100%;
    padding: 28px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.86);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.2);
    box-sizing: border-box;
}

#mypage .form-group label {
    color: #cbd5e1;
}

#mypage .form-group input {
    width: 100%;
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.32);
    box-sizing: border-box;
}

#mypage .form-group input[readonly] {
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.96);
    border-color: rgba(148, 163, 184, 0.28);
}

#mypage .form-group input::placeholder {
    color: #94a3b8;
}

#mypage .section-divider {
    border-top-color: rgba(148, 163, 184, 0.22) !important;
}

@media (max-width: 768px) {
    #mypage .header {
        padding-left: 16px;
        padding-right: 16px;
    }

    #mypage .auth-container {
        padding: 0 16px 32px;
    }

    #mypage .auth-form {
        padding: 20px;
    }
}
