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

        body {
            font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background: linear-gradient(to bottom right, #0f172a, #3b0764, #0f172a);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            overflow-x: hidden;
            margin: 0;
            padding: 0;
        }

        .scale-wrapper {
            width: 100%;
            max-width: 100%;
            display: flex;
            justify-content: center;
            padding: 10px 0;
            overflow: hidden;
        }

        .container {
            max-width: 809px;
            width: 809px;
            margin: 0 auto;
            padding: 0;
            display: grid;
            grid-template-columns: repeat(2, 400px);
            gap: 9px;
            justify-content: center;
        }

        .header-container {
            grid-column: 1 / -1;
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            margin-top: 10px;
            margin-bottom: 12px;
        }

        h1 {
            color: white;
            font-size: 3em;
            font-weight: 600;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
            margin: 0;
            white-space: nowrap;
        }

        .time-info {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            align-items: flex-start;
            justify-content: flex-end;
            color: rgba(255,255,255,0.9);
            font-size: 0.75em;
            gap: 15px 20px;
        }

        .time-block {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 3px;
            max-width: 100%;
        }

        .time-label {
            font-size: 0.8em;
            color: #a8b2d1;
            opacity: 0.8;
        }

        .time-value {
            color: #a8b2d1;
            opacity: 0.8;
            display: flex;
            align-items: center;
            gap: 8px;
            max-width: 100%;
        }

        .time-value span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .market-status {
            font-size: 0.75em;
            padding: 2px 8px;
            border-radius: 10px;
            font-weight: 500;
        }

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

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

        .grid {
            grid-column: 1 / -1;
            display: grid;
            grid-template-columns: repeat(2, 400px);
            gap: 9px;
            margin-bottom: 20px;
            justify-content: center;
        }


        .card {
            background: #0f172a;
            border-radius: 20px;
            padding: 10px 20px;
            box-shadow: none;
            transition: all 0.3s ease;
            user-select: none;
            pointer-events: none;
            border: 2px solid transparent;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .card:hover {
            transform: translateY(-8px);
            box-shadow: none;
        }

        .card-top-row {
            display: flex;
            justify-content: flex-start;
            align-items: flex-start;
            margin-bottom: 0;
            gap: 0;
            height: 36px;
        }

        .card-title-section {
            display: flex;
            flex-direction: column;
            gap: 1px;
            align-items: flex-start;
            width: 264px;
            margin-right: 8px;
            overflow: hidden;
        }

        .card-title-group {
            display: flex;
            align-items: flex-end;
            gap: 8px;
        }

        .trend-icon {
            width: 15px;
            height: 15px;
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: none;
            padding: 0;
            border: none;
        }

        .trend-icon svg {
            width: 15px;
            height: 15px;
        }

        .trend-icon.positive {
            color: #10b981;
            background: none;
        }

        .trend-icon.negative {
            color: #ef4444;
            background: none;
        }

        .trend-icon.market-closed {
            color: #9ca3af;
            background: none;
        }

        .card-title {
            font-size: 1.1em;
            color: #ffffff;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 0;
            white-space: nowrap;
        }

        .card-label {
            font-size: 0.7em;
            color: #a8b2d1;
            white-space: nowrap;
            line-height: 1.2;
            min-height: 0.84em; /* 0.7em * 1.2 line-height */
            display: block;
        }

        .card-label:empty {
            visibility: hidden;
        }

        .previous-close {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            font-size: 0.7em;
            color: #a8b2d1;
            text-align: right;
            white-space: nowrap;
        }

        .previous-close-label {
            opacity: 0.7;
            margin-bottom: 2px;
        }

        .previous-close-value {
            font-size: 1.05em;
            font-weight: 600;
            color: #a8b2d1;
        }

        .card-body {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            gap: 0;
            height: 70px;
        }

        .card-value {
            font-size: 2em;
            font-weight: bold;
            color: #ffffff;
            text-shadow: 0 2px 4px rgba(0,0,0,0.3);
            white-space: nowrap;
            line-height: 1.2;
        }

        .card-value.market-closed {
            color: #b5b5b5 !important;
            background: none !important;
            background-color: transparent !important;
        }

        .card-change {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 2px;
            min-width: 100px;
        }

        .change-amount {
            font-size: 1em;
            font-weight: 600;
            line-height: 1.2;
            text-align: right;
            width: 100%;
        }

        .change-percent {
            font-size: 0.85em;
            opacity: 0.9;
            line-height: 1.2;
            text-align: right;
            width: 100%;
        }


        .positive {
            color: #10b981 !important;  /* green - rise/increase */
        }

        .negative {
            color: #ef4444 !important;  /* red - fall/decrease */
        }

        .loading {
            text-align: center;
            color: white;
            font-size: 1.2em;
        }

        .error {
            grid-column: 1 / -1;
            background: #e74c3c;
            color: white;
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
            text-align: center;
        }

        .refresh-btn {
            padding: 12px 30px;
            background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
            color: #1a1a2e;
            border: none;
            border-radius: 25px;
            font-size: 1em;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
            transition: all 0.3s ease;
            white-space: nowrap;
        }

        .refresh-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 12px 30px rgba(255, 215, 0, 0.5);
            background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
        }

        .info-section {
            background: linear-gradient(135deg, rgba(45, 53, 97, 0.6) 0%, rgba(31, 37, 68, 0.6) 100%);
            border-radius: 20px;
            padding: 25px;
            margin-top: 20px;
            color: white;
            border: 1px solid rgba(255, 215, 0, 0.1);
            backdrop-filter: blur(10px);
        }

        .info-section h3 {
            margin-bottom: 10px;
            color: #ffd700;
            font-size: 1.2em;
        }

        .info-section p {
            line-height: 1.8;
            opacity: 0.9;
            color: #a8b2d1;
        }

        .deviation-card .card-label {
            color: #1a1a2e;
            opacity: 0.8;
        }


        .krx-gold-card .card-title,
        .deviation-card .card-title {
            color: #ffffff;
            font-weight: 900;
        }

        .krx-gold-card .card-value,
        .deviation-card .card-value {
            color: #ffffff;
            text-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }

        .krx-gold-card .card-label,
        .deviation-card .card-label {
            color: #a8b2d1;
        }


        .usd-krw-card .card-title {
            color: #ffffff;
            font-weight: 900;
        }

        .usd-krw-card .card-value {
            color: #ffffff;
            text-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }

        .usd-krw-card .card-label {
            color: #a8b2d1;
        }

        /* Unified dark card style */
        .btc-card,
        .eth-card,
        .xau-card,

        .btc-card .card-title,
        .eth-card .card-title,
        .xrp-card .card-title,
        .sol-card .card-title,
        .xau-card .card-title,
        .sp500-card .card-title,
        .nasdaq-card .card-title,
        .kospi-card .card-title {
            color: #ffffff;
            font-weight: 900;
        }

        .btc-card .card-value,
        .eth-card .card-value,
        .xrp-card .card-value,
        .sol-card .card-value,
        .xau-card .card-value,
        .sp500-card .card-value,
        .nasdaq-card .card-value,
        .kospi-card .card-value {
            color: #ffffff;
            text-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }

        .btc-card .card-label,
        .eth-card .card-label,
        .xrp-card .card-label,
        .sol-card .card-label,
        .xau-card .card-label,
        .sp500-card .card-label,
        .nasdaq-card .card-label,
        .kospi-card .card-label {
            color: #a8b2d1;
        }

        /* Modern Widget Style - All Cards */
        .card-body {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            gap: 0;
        }

        .price-info {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: flex-start;
            width: 140px;
            min-width: 140px;
            flex-shrink: 0;
            gap: 3px;
            margin-right: 4px;
        }

        .card-market-status-section {
            display: flex;
            align-items: center;
            justify-content: center;
            white-space: nowrap;
            min-width: fit-content;
            padding-top: 2px;
        }

        .card-market-status {
            font-size: 0.6em;
            padding: 1px 6px 2px 6px;
            border-radius: 4px;
            font-weight: 600;
            display: inline-block !important;
            align-items: center;
            white-space: pre-line !important;
            line-height: 1.3;
            text-align: right !important;
        }

        .card-market-status.market-open {
            background: rgba(255, 215, 0, 0.2);
            color: #ffd700;
        }

        .card-market-status.market-closed {
            background: rgba(181, 181, 181, 0.2);
            color: #b5b5b5;
        }

        .previous-close-section {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 1px;
            width: 80px;
            min-width: 80px;
            margin-left: auto;
            flex-shrink: 0;
            padding-top: 0;
        }

        .previous-close-label-only {
            font-size: 0.7em;
            color: rgba(255, 255, 255, 0.6);
            font-weight: 500;
        }

        .previous-close-value-only {
            font-size: 0.75em;
            color: #a8b2d1;
            font-weight: 600;
        }

        .sparkline-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 120px;
            height: 70px;
            flex-shrink: 0;
            margin-left: 8px;
            overflow: visible;
        }

        .sparkline-canvas {
            width: 120px;
            height: 70px;
        }

        .card-body .card-change {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            justify-content: center;
            gap: 2px;
            width: auto;
            min-width: 80px;
            flex-shrink: 0;
            margin-left: auto;
            margin-top: -6px;
        }

        /* Affiliate CTA Button - below change percent */
        /* HIDDEN: Waiting for Binance Affiliate approval */
        .card-change .trade-btn {
            display: none; /* Hidden until affiliate signup complete */
            /* display: inline-block; */ /* Uncomment after affiliate approval */
            height: 18px;
            margin-top: 4px;
            padding: 2px 5px;
            font-size: 0.6em;
            font-weight: 600;
            color: #ffd700;
            background: transparent;
            border: 1px solid rgba(255, 215, 0, 0.4);
            border-radius: 3px;
            text-decoration: none;
            transition: all 0.2s ease;
            cursor: pointer;
            white-space: nowrap;
            line-height: 1.2;
            align-self: flex-end;
        }

        .card-change .trade-btn:hover {
            background: rgba(255, 215, 0, 0.1);
            border-color: rgba(255, 215, 0, 0.6);
            color: #fff;
            transform: translateY(-1px);
        }

        .card-change .trade-btn:active {
            transform: translateY(0);
        }

        /* Combined Border Pulse + Flash animations (matching demo) */
        @keyframes glow-green {
            0%, 100% {
                border: 2px solid transparent;
                box-shadow: none;
                background-color: #0f172a;
            }
            50% {
                border: 2px solid #10b981;  /* #10b981 - rise/increase */
                box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
                background-color: rgba(16, 185, 129, 0.25);
            }
        }

        @keyframes glow-red {
            0%, 100% {
                border: 2px solid transparent;
                box-shadow: none;
                background-color: #0f172a;
            }
            50% {
                border: 2px solid #ef4444;  /* #ef4444 - fall/decrease */
                box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
                background-color: rgba(239, 68, 68, 0.25);
            }
        }

        .card.glow-green {
            animation: glow-green 0.8s ease-in-out;
        }

        .card.glow-red {
            animation: glow-red 0.8s ease-in-out;
        }
