:root {
    --primary: #8B5CF6;
    --primary-light: #A78BFA;
    --primary-dark: #6D28D9;
    --secondary: #10B981;
    --bg-dark: #0F172A;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --accent-glow: rgba(139, 92, 246, 0.5);
    --font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

#top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo-container:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem;
    border-radius: 100px;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.lang-switch {
    display: flex;
    gap: 0.5rem;
}

.lang-switch button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.lang-switch button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.lang-switch button.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    border-color: var(--primary);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 20px;
    display: none;
}

.dropdown:hover::after {
    display: block;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0.75rem;
    min-width: 220px;
    display: none;
    list-style: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    width: 100%;
    padding: 0.8rem 1.2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-radius: 12px;
    text-align: left;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(8px);
    }
}

/* Home Page Styles */
.home-container {
    width: 100%;
    max-width: 100%;
    padding: 0 2rem;
}

.home-header {
    text-align: center;
    margin-bottom: 4rem;
}

.home-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #FFF 0%, #A78BFA 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.home-header p {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.col-span-full {
    grid-column: 1 / -1;
}

@media (max-width: 1024px) {
    .tool-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 3.5rem 2.5rem 2.5rem 2.5rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.tool-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-icon {
    width: 60px;
    height: 60px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary-light);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-icon .lucide {
    width: 32px;
    height: 32px;
}

.tool-info h3 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.tool-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Badge Styles */
.badge-container {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    display: flex;
    gap: 0.5rem;
    z-index: 2;
}

.badge {
    padding: 0.35rem 0.6rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.badge-logo {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.badge-marlin {
    background: rgba(59, 130, 246, 0.15);
    color: #93C5FD;
    border-color: rgba(96, 165, 250, 0.3);
}

.badge-klipper {
    background: rgba(16, 185, 129, 0.15);
    color: #6EE7B7;
    border-color: rgba(52, 211, 153, 0.3);
}

.tool-action {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    color: var(--primary-light);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.4s ease;
}

.tool-card:hover .tool-action {
    opacity: 1;
    transform: translateX(0);
}

main {
    flex: 1;
    padding: 3rem 1rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#content {
    width: 100%;
    max-width: 1400px;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 32px;
    padding: 3rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 950px;
    margin: 0 auto;
    width: 100%;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #FFF 0%, #A78BFA 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

h2 .lucide {
    color: var(--primary-light);
    width: 32px;
    height: 32px;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input,
select {
    width: 100%;
    padding: 1.1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.result-area {
    margin-top: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.result-area::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.1), transparent 70%);
    pointer-events: none;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.result-item:last-child {
    margin-bottom: 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.result-item span:first-child {
    font-weight: 500;
    color: var(--text-muted);
}

.result-value {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--primary-light);
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.instructions {
    margin-top: 3rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.instructions h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.instructions h3 .lucide {
    width: 20px;
    height: 20px;
    color: var(--primary-light);
}

.instructions p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Firmware Section Styles */
.firmware-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.firmware-section h3 {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.firmware-section h3 .lucide {
    color: var(--primary-light);
    width: 24px;
    height: 24px;
}

.code-group {
    margin-bottom: 1.5rem;
}

.code-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.code-block {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.code-block code {
    display: block;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--primary-light);
    white-space: pre-wrap;
    word-break: break-all;
}

.code-note {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--secondary);
    opacity: 0.8;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.code-note::before {
    content: '💡';
    font-style: normal;
}

/* Step-by-Step Guide Styles */
.esteps-guide {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, background 0.3s ease;
}

.step-container a {
    color: var(--text-main);
    font-weight: bold;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--primary);
}

.step-container:hover {
    background: rgba(255, 255, 255, 0.04);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-number {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
    flex-shrink: 0;
}

.step-header h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin: 0;
}

.step-content {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.step-img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 12px;
    margin: 1rem 0;
    border: 1px solid var(--glass-border);
}

.gcode-instructions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.gcode-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.gcode-item label {
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    text-transform: none;
}

.gcode-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.gcode-item code {
    display: block;
    color: var(--primary-light);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

footer {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.4);
}

/* Price Calculator Overrides */
.price-calculator h3 {
    margin: 2.5rem 0 1.5rem 0;
    font-size: 1.25rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.price-calculator h3 .lucide {
    width: 22px;
    height: 22px;
    color: var(--primary-light);
}

.price-calculator h3::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.calc-section {
    margin-bottom: 2.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.price-results {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.main-result {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 1.5rem;
}

.highlight {
    color: var(--secondary);
    font-size: 2.5rem;
    font-weight: 900;
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
    margin: 0.5rem 0;
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    #top-nav {
        flex-direction: column;
        gap: 1.5rem;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        overflow-x: auto;
        padding: 0.25rem;
    }

    .nav-links a {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .card {
        padding: 2rem 1.5rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* Skew Calibration Specific Styles */
.calibration-split {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.cal-inputs {
    flex: 1;
}

.cal-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.guide-img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.measure-table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: separate;
    border-spacing: 0;
}

.measure-table th,
.measure-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

.measure-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.measure-table input {
    width: 80px;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.readonly-val {
    font-weight: bold;
    color: var(--primary-light);
}

.row-avg {
    font-weight: bold;
}

.row-dev {
    font-family: monospace;
    color: var(--text-muted);
}

.row-status {
    font-weight: 800;
}

.status-ok {
    color: var(--secondary);
}

.status-ko {
    color: #ef4444;
    /* Red-500 */
}

.total-value {
    font-weight: 900;
    color: var(--primary-light);
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

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

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

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

.info-box {
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.info-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Button overrides */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

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

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

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

@media (max-width: 768px) {
    .calibration-split {
        flex-direction: column;
    }

    .measure-table {
        display: block;
        overflow-x: auto;
    }
}

/* Bed Mesh Tool Styles */
.mesh-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.mesh-sidebar {
    width: 350px;
    flex-shrink: 0;
}

.mesh-viz-area {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.file-upload-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.file-upload-zone:hover,
.file-upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

.file-upload-zone input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.viz-container {
    display: none;
    flex: 1;
}

.viz-container.active {
    display: flex;
    flex-direction: column;
}

.mesh-grid {
    display: grid;
    gap: 4px;
    /* Using gap for visual separation */
    aspect-ratio: 1;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    padding: 10px;
    border-radius: 8px;
}

.grid-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    transition: transform 0.2s;
}

.grid-cell:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Tape Grid Colors */
.tape-cell {
    background: rgba(255, 255, 255, 0.05);
    /* Default */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tape-0 {
    background: rgba(16, 185, 129, 0.2);
    /* Green tint */
    color: var(--secondary);
}

.tape-low {
    background: rgba(250, 204, 21, 0.3);
    /* Yellow tint */
    color: #fca5a5;
    /* ? */
}

.tape-low .tape-count {
    color: #facc15;
}

.tape-high {
    background: rgba(239, 68, 68, 0.3);
    /* Red tint */
}

.tape-high .tape-count {
    color: #f87171;
    font-size: 1.2em;
}

.tape-count {
    font-size: 1.2em;
    margin-bottom: 2px;
}

.z-val {
    font-size: 0.7em;
    opacity: 0.7;
    font-weight: normal;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
}

.stat-card .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-card .value {
    font-weight: bold;
    color: var(--primary-light);
    font-size: 1.1rem;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.placeholder-msg {
    grid-column: 1 / -1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
}

.gradient-bar {
    width: 200px;
    height: 10px;
    background: linear-gradient(to right,
            hsl(240, 70%, 50%),
            hsl(180, 70%, 50%),
            hsl(120, 70%, 50%),
            hsl(60, 70%, 50%),
            hsl(0, 70%, 50%));
    border-radius: 5px;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    width: 200px;
    font-size: 0.75rem;
}

@media (max-width: 900px) {
    .mesh-layout {
        flex-direction: column;
    }

    .mesh-sidebar {
        width: 100%;
    }

    .mobile-hidden {
        display: none;
    }
}

/* Vref Specific Styles */
.vref-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.grid-span-all {
    grid-column: 1 / -1;
}

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

.results-display {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-item.highlight .value {
    color: var(--secondary);
    font-size: 1.8rem;
}

.result-item.highlight .label {
    font-size: 0.9rem;
}

.config-code {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 16px !important;
    padding: 1.25rem !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
    font-size: 0.95rem !important;
    color: var(--primary-light) !important;
    margin: 0 !important;
    white-space: pre-wrap !important;
    line-height: 1.5 !important;
}

.doc-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
}

.doc-link:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
    transform: translateX(8px);
    color: var(--primary-light);
}

.doc-link .lucide {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

/* Input Shaper Specific Styles */
.upload-zone {
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
}

.upload-zone:hover,
.upload-zone.active {
    background: rgba(139, 92, 246, 0.05);
    border-color: var(--primary);
    color: var(--text-main);
    transform: translateY(-4px);
}

.upload-zone i {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.file-name {
    font-size: 0.8rem;
    color: var(--primary-light);
    word-break: break-all;
}

.result-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
}

.shaper-table {
    overflow-x: auto;
}

.shaper-recommendation {
    border-left: 4px solid var(--primary);
}