/* Ring Calculator - shared styles */
* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
            color: #333;
            min-height: 100vh;
        }

        /* Header Styles */
        header {
            background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
            padding: 15px 0;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            position: sticky;
            top: 0;
            z-index: 999;
        }

        .header-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo-link {
            display: flex;
            align-items: center;
            text-decoration: none;
            gap: 12px;
        }

        .logo {
            width: 45px;
            height: 45px;
            background: linear-gradient(135deg, #D4AF37 0%, #C19B2C 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 1.3em;
            color: white;
            box-shadow: 0 3px 10px rgba(212, 175, 55, 0.3);
        }

        .site-title {
            color: white;
            font-size: 1.2em;
            font-weight: 300;
            letter-spacing: 1px;
        }

        nav {
            display: flex;
            align-items: center;
            gap: 30px;
        }

        .nav-menu {
            display: flex;
            list-style: none;
            gap: 25px;
            margin: 0;
        }

        .nav-menu a {
            color: #ccc;
            text-decoration: none;
            font-size: 0.95em;
            transition: color 0.3s ease;
            padding: 5px 0;
        }

        .nav-menu a:hover {
            color: #D4AF37;
        }

        /* Language Dropdown */
        .language-selector {
            position: relative;
        }

        .language-btn {
            background: transparent;
            border: 1px solid #D4AF37;
            color: #D4AF37;
            padding: 8px 15px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 0.9em;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s ease;
        }

        .language-btn:hover {
            background: #D4AF37;
            color: white;
        }

        .language-dropdown {
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 10px;
            background: white;
            border: 2px solid #D4AF37;
            border-radius: 8px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.2);
            min-width: 150px;
            display: none;
            z-index: 1000;
        }

        .language-dropdown.show {
            display: block;
        }

        .language-dropdown a {
            display: block;
            padding: 12px 20px;
            color: #333;
            text-decoration: none;
            font-size: 0.9em;
            transition: all 0.3s ease;
            border-bottom: 1px solid #f0f0f0;
        }

        .language-dropdown a:last-child {
            border-bottom: none;
        }

        .language-dropdown a:hover {
            background: #D4AF37;
            color: white;
        }

        /* Mobile Menu */
        .mobile-menu-btn {
            display: none;
            background: transparent;
            border: 2px solid #D4AF37;
            color: #D4AF37;
            padding: 8px 12px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 1.2em;
        }

        @media (max-width: 768px) {
            .nav-menu {
                display: none;
                position: absolute;
                top: 100%;
                left: 0;
                right: 0;
                background: #1a1a1a;
                flex-direction: column;
                padding: 20px;
                gap: 15px;
                box-shadow: 0 5px 20px rgba(0,0,0,0.3);
            }

            .nav-menu.show {
                display: flex;
            }

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

            nav {
                position: relative;
                width: 100%;
                justify-content: flex-end;
            }
        }

        /* Main Content */
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }

        h1 {
            text-align: center;
            color: #D4AF37;
            font-size: 2.5em;
            margin-bottom: 10px;
            font-weight: 300;
            letter-spacing: 2px;
        }

        .subtitle {
            text-align: center;
            color: #666;
            margin-bottom: 40px;
            font-size: 1.1em;
        }

        /* Calibration Section */
        .calibration-section {
            background: white;
            border-radius: 20px;
            padding: 40px;
            margin-bottom: 40px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.08);
            border: 3px solid #D4AF37;
            max-width: 800px;
            margin-left: auto;
            margin-right: auto;
        }

        .calibration-section.completed {
            opacity: 0.6;
            max-height: 120px;
            overflow: hidden;
            transition: all 0.5s ease;
            cursor: pointer;
        }

        .calibration-section.completed:hover {
            opacity: 0.8;
        }

        .calibration-card {
            max-width: 100%;
        
            
        
            overflow: visible;
            max-width: 100%;
        }

        .calibration-card h2 {
            color: #D4AF37;
            font-size: 2em;
            margin-bottom: 20px;
            text-align: center;
            font-weight: 300;
        }

        .calibration-completed-badge {
            display: none;
            background: #D4AF37;
            color: white;
            padding: 8px 20px;
            border-radius: 50px;
            font-size: 0.9em;
            font-weight: 500;
            margin-left: 15px;
        }

        .calibration-section.completed .calibration-completed-badge {
            display: inline-block;
        }

        .calibration-section.completed h2 {
            display: inline-block;
            font-size: 1.5em;
        }

        .why-calibrate {
            background: #fff9e6;
            border-left: 4px solid #D4AF37;
            padding: 20px;
            margin-bottom: 30px;
            border-radius: 5px;
        }

        .why-calibrate h3 {
            color: #D4AF37;
            font-size: 1.2em;
            margin-bottom: 10px;
        }

        .why-calibrate p {
            color: #666;
            line-height: 1.8;
            font-size: 0.95em;
        }

        .calibration-steps {
            margin-bottom: 30px;
        }

        .calibration-steps h3 {
            color: #333;
            font-size: 1.1em;
            margin-bottom: 15px;
        }

        .calibration-steps ol {
            margin-left: 20px;
            line-height: 2;
            color: #555;
        }

        .credit-card-display {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            border-radius: 15px;
            padding: 24px 10px 32px;
            margin: 16px 0;
            position: relative;
            box-shadow: 0 8px 20px rgba(0,0,0,0.2);
            min-height: 140px;
            height: auto !important;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: visible !important;
            width: 100%;
            box-sizing: border-box;
        }

        .credit-card {
            width: 200px;
            height: 126px;
            background: linear-gradient(135deg, #D4AF37 0%, #C19B2C 100%);
            border-radius: 12px;
            position: relative;
            box-shadow: 0 5px 15px rgba(0,0,0,0.3);
            transition: none;
            max-width: none !important;
            max-height: none !important;
            flex-shrink: 0;
        }

        .credit-card::before {
            content: '';
            position: absolute;
            top: 20px;
            left: 20px;
            width: 50px;
            height: 40px;
            background: linear-gradient(135deg, #f0d98d 0%, #D4AF37 100%);
            border-radius: 5px;
        }

        .credit-card::after {
            content: 'CREDIT CARD';
            position: absolute;
            bottom: 20px;
            left: 20px;
            color: white;
            font-size: 0.9em;
            letter-spacing: 2px;
            font-weight: 300;
        }

        .card-label {
            position: absolute;
            bottom: -22px;
            left: 50%;
            transform: translateX(-50%);
            color: #D4AF37;
            font-size: 0.85em;
            font-weight: 600;
            white-space: nowrap;
            pointer-events: none;
        }
        .credit-card.vertical .card-label {
            bottom: auto;
            top: -22px;
        }


        /* Calibration method tabs */
        .calib-panel { overflow: visible; }
        .calib-method-tabs {
            display: flex;
            gap: 10px;
            margin: 20px 0 25px;
            justify-content: center;
        }
        .calib-tab {
            flex: 1;
            max-width: 180px;
            padding: 12px 16px;
            border: 2px solid #D4AF37;
            background: white;
            color: #333;
            border-radius: 50px;
            font-size: 1em;
            cursor: pointer;
            transition: all 0.25s ease;
            font-weight: 500;
        }
        .calib-tab.active {
            background: #D4AF37;
            color: white;
        }
        .calib-tab:hover { background: #f8f0d0; }
        .calib-tab.active:hover { background: #C19B2C; }

        .credit-card.vertical {
            max-width: none !important;
            max-height: none !important;
        }
        .credit-card.vertical::after {
            content: 'CARD';
            writing-mode: vertical-rl;
            font-size: 0.75em;
        }
        
        
        
        
        
        
        @media (max-width: 768px) {
            .credit-card { max-width: none !important; max-height: none !important; }
            .credit-card::after {
                content: 'CARD';
                writing-mode: vertical-rl;
                font-size: 0.7em;
            }
            .calib-method-tabs { flex-direction: column; align-items: stretch; }
            .calib-tab { max-width: none; }
            .credit-card-display {
                min-height: 180px;
                height: auto;
                overflow: visible;
                padding: 28px 10px 40px;
            }
        }


        


        /* ===== Dual-scale ruler (CM + Inches) ===== */
        .ruler-display {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            border-radius: 15px;
            padding: 20px 0 36px 8px; /* no right padding so bar can run off */
            margin: 16px 0;
            display: block;
            overflow-x: hidden; /* clip: ruler disappears on the right */
            overflow-y: visible;
            width: 100%;
            box-sizing: border-box;
            position: relative;
        }
        .virtual-ruler {
            position: relative;
            background: linear-gradient(180deg, #faf8f2 0%, #f0ede4 100%);
            border: 2px solid #D4AF37;
            border-radius: 8px 0 0 8px; /* open on the right as it extends */
            width: 280px;
            max-width: none !important;
            height: 88px;
            transition: none;
            box-shadow: 0 6px 18px rgba(0,0,0,0.35);
            box-sizing: border-box;
            overflow: visible;
            flex-shrink: 0;
            margin-left: 0;
            transform-origin: left center;
            display: block;
        }
        .ruler-cm-side {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 38px;
            border-bottom: 1px solid #c9c4b5;
        }
        .ruler-inch-side {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 38px;
            border-top: 1px solid #c9c4b5;
        }
        .ruler-unit-label {
            position: absolute;
            left: 2px;
            font-size: 0.55em;
            font-weight: 800;
            color: #888;
            letter-spacing: 0.5px;
            z-index: 3;
            background: rgba(250,248,242,0.95);
            padding: 0 2px;
            border-radius: 2px;
            line-height: 1;
        }
        .ruler-cm-side .ruler-unit-label { top: 1px; }
        .ruler-inch-side .ruler-unit-label { bottom: 1px; }
        .ruler-cm-side .ruler-unit-label { top: 2px; }
        .ruler-inch-side .ruler-unit-label { bottom: 2px; }
        .ruler-ticks-cm {
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            height: 100%;
            padding: 0;
            margin: 0;
            box-sizing: border-box;
            width: 100%;
        }
        .ruler-ticks-in {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            height: 100%;
            padding: 0;
            margin: 0;
            box-sizing: border-box;
            width: 100%;
        }
        .ruler-ticks-cm span,
        .ruler-ticks-in span {
            position: relative;
            flex: 1;
            text-align: center;
            font-size: 0.72em;
            font-weight: 700;
            color: #1a1a1a;
            line-height: 1;
        }
        /* CM ticks grow upward from the center line */
        .ruler-ticks-cm span::after {
            content: '';
            position: absolute;
            left: 50%;
            bottom: 14px;
            transform: translateX(-50%);
            width: 1.5px;
            height: 8px;
            background: #333;
        }
        .ruler-ticks-cm span:nth-child(odd)::after { height: 14px; }
        .ruler-ticks-cm span:first-child::after,
        .ruler-ticks-cm span:last-child::after {
            height: 18px;
            width: 2px;
            background: #000;
        }
        /* Inch ticks grow downward from the center line */
        .ruler-ticks-in span::after {
            content: '';
            position: absolute;
            left: 50%;
            top: 14px;
            transform: translateX(-50%);
            width: 1.5px;
            height: 8px;
            background: #333;
        }
        .ruler-ticks-in span:nth-child(odd)::after { height: 14px; }
        .ruler-ticks-in span:first-child::after,
        .ruler-ticks-in span:last-child::after {
            height: 18px;
            width: 2px;
            background: #000;
        }
        .ruler-body {
            position: absolute;
            top: 38px;
            left: 0;
            right: 0;
            height: 12px;
            background: repeating-linear-gradient(
                90deg,
                #ddd8c8 0px,
                #ddd8c8 1px,
                transparent 1px,
                transparent 3.4px
            );
        }
        .ruler-length-label {
            position: absolute;
            bottom: -24px;
            left: 50%;
            transform: translateX(-50%);
            color: #D4AF37;
            font-size: 0.82em;
            font-weight: 700;
            white-space: nowrap;
            pointer-events: none;
        }
        @media (max-width: 420px) {
            .virtual-ruler { height: 80px; }
            .ruler-ticks-cm span, .ruler-ticks-in span { font-size: 0.62em; }
            .ruler-unit-label { font-size: 0.52em; }
        }

        .calibration-slider-container {
            margin: 28px 0 20px 0;
            padding: 18px 14px;
            background: #fafafa;
            border-radius: 12px;
            border: 1px solid #eee;
            display: block !important;
            visibility: visible !important;
            position: relative;
            z-index: 20;
            clear: both;
        }

        .calibration-instruction {
            text-align: center;
            color: #D4AF37;
            font-size: 1.1em;
            margin-bottom: 15px;
            font-weight: 500;
        }

        .slider {
            width: 100%;
            height: 10px;
            border-radius: 5px;
            background: linear-gradient(to right, #e8e8e8 0%, #D4AF37 50%, #e8e8e8 100%);
            outline: none;
            -webkit-appearance: none;
            display: block !important;
            margin: 10px 0;
            cursor: pointer;
        }

        .slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: #D4AF37;
            cursor: pointer;
            box-shadow: 0 2px 8px rgba(212, 175, 55, 0.5);
            transition: all 0.3s ease;
            border: 2px solid #fff;
        }

        .slider::-webkit-slider-thumb:hover {
            transform: scale(1.15);
            box-shadow: 0 3px 12px rgba(212, 175, 55, 0.7);
        }

        .slider::-moz-range-thumb {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: #D4AF37;
            cursor: pointer;
            border: none;
            box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
        }

        .calibration-btn {
            background: #D4AF37;
            color: white;
            border: none;
            padding: 15px 40px;
            border-radius: 50px;
            font-size: 1.1em;
            cursor: pointer;
            width: 100%;
            transition: all 0.3s ease;
            letter-spacing: 1px;
            font-weight: 500;
        }

        .calibration-btn:hover {
            background: #C19B2C;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
        }

        .calibration-btn:disabled {
            background: #ccc;
            cursor: not-allowed;
            transform: none;
        }

        /* Main Content */
        .methods {
            display: flex;
            flex-direction: column;
            gap: 30px;
            margin-bottom: 40px;
            align-items: center;
        }

        .method-card {
            background: white;
            border-radius: 15px;
            padding: 30px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.08);
            transition: transform 0.3s ease;
            width: 100%;
            max-width: 800px;
        }

        .method-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(212, 175, 55, 0.15);
        }

        .method-card h2 {
            color: #D4AF37;
            font-size: 1.5em;
            margin-bottom: 20px;
            font-weight: 400;
            border-bottom: 2px solid #D4AF37;
            padding-bottom: 10px;
        }

        .instructions {
            background: #f9f9f9;
            border-left: 3px solid #D4AF37;
            padding: 15px;
            margin-bottom: 20px;
            border-radius: 5px;
        }

        .instructions h3 {
            color: #D4AF37;
            font-size: 1em;
            margin-bottom: 10px;
            font-weight: 500;
        }

        .instructions ol {
            margin-left: 20px;
            line-height: 1.8;
        }

        .instructions li {
            color: #555;
            font-size: 0.95em;
        }

        .interactive-area {
            background: #fafafa;
            border: 2px dashed #D4AF37;
            border-radius: 10px;
            padding: 30px;
            text-align: center;
            min-height: 300px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .ring-display {
            position: relative;
            margin: 20px auto;
        }

        .ring {
            box-sizing: content-box;
            box-sizing: content-box;
            box-sizing: content-box;
            width: 150px;
            height: 150px;
            border: 2px solid #D4AF37;
            border-radius: 50%;
            background: transparent;
            box-shadow: none;
            transition: all 0.3s ease;
            margin: 0 auto;
        }

        .finger-display {
            position: relative;
            width: 200px;
            height: 300px;
            margin: 20px auto;
        }

        .finger {
            width: 80px;
            height: 250px;
            background: linear-gradient(to bottom, #f5d4c1 0%, #e8b89a 100%);
            border-radius: 40px 40px 20px 20px;
            margin: 0 auto;
            position: relative;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }

        .finger::before {
            content: '';
            position: absolute;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            width: 30px;
            height: 40px;
            background: rgba(232, 184, 154, 0.5);
            border-radius: 50%;
        }

        .rectangles {
            position: absolute;
            width: 100%;
            left: 0;
        }

        .rectangle {
            position: absolute;
            width: 100%;
            height: 3px;
            background: #D4AF37;
            left: 0;
            box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
        }

        .rect-top {
            top: 80px;
        }

        .rect-bottom {
            top: 120px;
        }

        .ribbon-display {
            position: relative;
            width: 100%;
            height: 150px;
            margin: 20px 0;
            pointer-events: none;
        }

        .ribbon {
            width: 200px;
            height: 30px;
            background: linear-gradient(to bottom, #D4AF37 0%, #C19B2C 100%);
            border-radius: 3px;
            margin: 0 auto;
            position: relative;
            box-shadow: 0 3px 10px rgba(0,0,0,0.2);
            transition: width 0.3s ease;
            pointer-events: none;
        }

        .ruler {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            width: 80%;
            height: 20px;
            background: white;
            border: 1px solid #D4AF37;
            border-radius: 3px;
            pointer-events: none;
        }

        .ruler-marks {
            display: flex;
            justify-content: space-between;
            height: 100%;
            padding: 0 5px;
            pointer-events: none;
        }

        .ruler-mark {
            width: 1px;
            background: #D4AF37;
            height: 50%;
            margin-top: auto;
            pointer-events: none;
        }

        .slider-container {
            width: 100%;
            margin: 20px 0;
            position: relative;
            z-index: 10;
        }

        .size-display {
            background: white;
            border: 2px solid #D4AF37;
            border-radius: 10px;
            padding: 20px;
            margin-top: 20px;
            text-align: center;
        }

        .size-label {
            color: #666;
            font-size: 0.9em;
            margin-bottom: 5px;
        }

        .size-value {
            color: #D4AF37;
            font-size: 2em;
            font-weight: bold;
        }

        .size-mm {
            color: #999;
            font-size: 0.9em;
            margin-top: 5px;
        }

        .recalibrate-btn {
            display: none;
            background: white;
            color: #D4AF37;
            border: 2px solid #D4AF37;
            padding: 12px 25px;
            border-radius: 50px;
            cursor: pointer;
            font-size: 0.9em;
            transition: all 0.3s ease;
            box-shadow: 0 3px 10px rgba(0,0,0,0.1);
            margin-top: 20px;
        }

        .recalibrate-btn.show {
            display: inline-block;
        }

        /* Content Sections */
        .content-section {
            background: white;
            border-radius: 15px;
            padding: 40px;
            margin-bottom: 30px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.08);
            max-width: 800px;
            margin-left: auto;
            margin-right: auto;
        }

        .content-section h2 {
            color: #D4AF37;
            font-size: 2em;
            margin-bottom: 20px;
            font-weight: 300;
            border-bottom: 2px solid #D4AF37;
            padding-bottom: 15px;
        }

        .content-section h3 {
            color: #333;
            font-size: 1.4em;
            margin: 25px 0 15px 0;
            font-weight: 400;
        }

        .content-section p {
            color: #555;
            line-height: 1.8;
            margin-bottom: 15px;
            font-size: 1.05em;
        }

        .content-section ul, .content-section ol {
            color: #555;
            line-height: 1.8;
            margin: 15px 0 15px 30px;
        }

        .content-section li {
            margin-bottom: 10px;
        }

        .faq-item {
            background: #f9f9f9;
            border-left: 4px solid #D4AF37;
            padding: 20px;
            margin-bottom: 20px;
            border-radius: 5px;
        }

        .faq-item h4 {
            color: #D4AF37;
            font-size: 1.2em;
            margin-bottom: 10px;
            font-weight: 500;
        }

        

        

        

        .feature-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin: 20px 0;
        }

        .feature-item {
            background: #f9f9f9;
            padding: 20px;
            border-radius: 10px;
            text-align: center;
        }

        .feature-item h4 {
            color: #D4AF37;
            margin-bottom: 10px;
        }

        footer {
            background: #1a1a1a;
            color: #ccc;
            padding: 30px 20px;
            text-align: center;
            margin-top: 50px;
        }

        footer a {
            color: #D4AF37;
            text-decoration: none;
        }

        footer a:hover {
            text-decoration: underline;
        }

        .footer-links {
            margin: 20px 0;
        }

        .footer-links a {
            margin: 0 15px;
        }

        /* Calibration Warning */
        .calibration-warning {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: white;
            border: 3px solid #D4AF37;
            border-radius: 15px;
            padding: 20px 30px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
            z-index: 999;
            max-width: 500px;
            display: none;
            animation: slideUp 0.3s ease;
        }

        .calibration-warning.show {
            display: block;
        }

        @keyframes slideUp {
            from {
                transform: translateX(-50%) translateY(100px);
                opacity: 0;
            }
            to {
                transform: translateX(-50%) translateY(0);
                opacity: 1;
            }
        }

        .calibration-warning-content {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .warning-icon {
            font-size: 2em;
            flex-shrink: 0;
        }

        .warning-text {
            flex: 1;
        }

        .warning-text h4 {
            color: #D4AF37;
            margin: 0 0 5px 0;
            font-size: 1.1em;
        }

        .warning-text p {
            margin: 0;
            color: #666;
            font-size: 0.95em;
        }

        .warning-actions {
            display: flex;
            gap: 10px;
            margin-top: 15px;
        }

        .warning-btn {
            padding: 10px 20px;
            border: none;
            border-radius: 25px;
            cursor: pointer;
            font-size: 0.9em;
            transition: all 0.3s ease;
        }

        .warning-btn-primary {
            background: #D4AF37;
            color: white;
        }

        .warning-btn-primary:hover {
            background: #C19B2C;
            transform: translateY(-2px);
        }

        .warning-btn-secondary {
            background: #f0f0f0;
            color: #666;
        }

        .warning-btn-secondary:hover {
            background: #e0e0e0;
        }

        /* Success Message */
        .success-message {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(135deg, #D4AF37 0%, #C19B2C 100%);
            color: white;
            border-radius: 15px;
            padding: 20px 40px;
            box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
            z-index: 1000;
            display: none;
            animation: slideDown 0.5s ease;
            text-align: center;
        }

        .success-message.show {
            display: block;
        }

        @keyframes slideDown {
            from {
                transform: translateX(-50%) translateY(-100px);
                opacity: 0;
            }
            to {
                transform: translateX(-50%) translateY(0);
                opacity: 1;
            }
        }

        .success-message h3 {
            margin: 0 0 10px 0;
            font-size: 1.3em;
            font-weight: 500;
        }

        .success-message p {
            margin: 0;
            font-size: 1em;
            opacity: 0.95;
        }

        .recalibrate-btn:hover {
            background: #D4AF37;
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
        }

        @media (max-width: 768px) {
            h1 {
                font-size: 2em;
            }

            .methods {
                grid-template-columns: 1fr;
            }

            .method-card {
                padding: 20px;
            }

            .calibration-card {
                padding: 25px;
            }

            .credit-card { max-width: none !important; max-height: none !important; }
        }

/* ===== RTL support (Arabic and similar) ===== */
html[dir="rtl"] body,
body.rtl {
    direction: rtl;
    text-align: right;
}
html[dir="rtl"] .instructions,
body.rtl .instructions {
    border-left: none;
    border-right: 3px solid #D4AF37;
}
html[dir="rtl"] .calibration-steps ol,
body.rtl .calibration-steps ol {
    margin-left: 0;
    margin-right: 20px;
}
html[dir="rtl"] .lang-switcher,
body.rtl .lang-switcher {
    left: 15px;
    right: auto;
}


/* ===== Ruler full-bleed on phones — extends & clips on the right ===== */
@media (max-width: 768px) {
    .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    .calibration-section {
        padding: 16px 8px !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 12px;
        overflow: visible !important;
    }
    .calibration-card {
        padding: 12px 4px !important;
        overflow: visible !important;
        max-width: 100% !important;
    }
    .calib-panel {
        overflow: visible !important;
        width: 100%;
    }
    .ruler-display {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 20px 0 36px 4px !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important; /* disappears on the right */
        overflow-y: visible !important;
    }
    .virtual-ruler {
        max-width: none !important;
        min-width: 0 !important;
        border-radius: 8px 0 0 8px !important;
    }
    .calibration-slider-container {
        margin-left: 4px;
        margin-right: 4px;
        z-index: 30;
        position: relative;
    }
}


