        :root {
            --bg-1: #0f172a;
            --bg-2: #312e81;
            --panel: rgba(15, 23, 42, 0.76);
            --panel-soft: rgba(255, 255, 255, 0.075);
            --border: rgba(255, 255, 255, 0.13);
            --text: #f8fafc;
            --muted: rgba(248, 250, 252, 0.7);
            --accent: #fbc531;
            --accent-hover: #fda502;
            --blue: #38bdf8;
            --green: #22c55e;
            --red: #ef4444;
            --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
        }

        * {
            box-sizing: border-box;
        }

        button,
        a,
        [role="button"] {
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            user-select: none;
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
        }

        html {
            touch-action: manipulation;
        }

        body {
            font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
            background:
                radial-gradient(circle at top left, rgba(56, 189, 248, 0.3), transparent 34%),
                radial-gradient(circle at top right, rgba(251, 197, 49, 0.22), transparent 28%),
                linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
            color: var(--text);
            margin: 0;
            min-height: 100vh;
            padding: 22px;
            overflow-x: hidden;
            -webkit-font-smoothing: antialiased;
        }

        body::before {
            content: "";
            position: fixed;
            inset: 0;
            pointer-events: none;
            background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
            background-size: 42px 42px;
            mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 72%);
        }

        .container {
            position: relative;
            max-width: 1240px;
            margin: 28px auto 0 auto;
            background: var(--panel);
            padding: 32px;
            border-radius: 26px;
            border: 1px solid var(--border);
            box-shadow: var(--shadow);
            backdrop-filter: blur(18px);
        }

        h1 {
            text-align: center;
            margin: 0 0 10px 0;
            font-size: clamp(30px, 5vw, 54px);
            line-height: 1.05;
            letter-spacing: -1.4px;
        }

        .subtitle {
            max-width: 760px;
            margin: 0 auto 28px auto;
            text-align: center;
            color: var(--muted);
            font-size: 15px;
            line-height: 1.5;
        }

        .hero-badges {
            display: flex;
            justify-content: center;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 28px;
        }

        .hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 9px 12px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: rgba(255, 255, 255, 0.82);
            font-size: 13px;
            font-weight: 800;
        }

        .market-strip {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 0 0 22px 0;
            padding: 12px;
            background: rgba(255, 255, 255, 0.075);
            border: 1px solid var(--border);
            border-radius: 18px;
            overflow-x: auto;
            scrollbar-width: thin;
        }

        .market-strip-label {
            flex: 0 0 auto;
            color: var(--muted);
            font-size: 12px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            padding: 0 4px;
        }

        .market-ticker-btn {
            flex: 0 0 auto;
            min-width: auto;
            height: 36px;
            padding: 0 14px;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.13);
            background: rgba(255, 255, 255, 0.09);
            color: rgba(255, 255, 255, 0.9);
            box-shadow: none;
            font-size: 13px;
            font-weight: 900;
        }

        .market-ticker-btn:hover {
            background: rgba(255, 255, 255, 0.16);
            transform: translateY(-1px);
            box-shadow: none;
        }

        .controls {
            display: grid;
            grid-template-columns: minmax(260px, 1.35fr) minmax(220px, 0.8fr) minmax(150px, auto);
            gap: 14px;
            align-items: end;
            margin-bottom: 22px;
            padding: 18px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.055));
            border: 1px solid var(--border);
            border-radius: 22px;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 34px rgba(0, 0, 0, 0.16);
        }

        .top-action-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 18px;
            flex-wrap: wrap;
            margin: 0 0 24px 0;
            padding: 16px;
            background: var(--panel-soft);
            border: 1px solid var(--border);
            border-radius: 22px;
        }

        .quick-amounts {
            display: flex;
            gap: 10px;
            justify-content: center;
            flex-wrap: wrap;
            margin: 0;
        }

        .quick-amount-btn {
            min-width: 82px;
            height: 40px;
            background: rgba(255, 255, 255, 0.11);
            border: 1px solid var(--border);
            border-radius: 999px;
            color: white;
            cursor: pointer;
            font-size: 14px;
            font-weight: 800;
            text-align: center;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0 16px;
        }

        .quick-amount-btn.active {
            background: var(--accent);
            color: #111827;
            border-color: rgba(255, 255, 255, 0.35);
        }

        .dividend-mode-row {
            display: flex;
            justify-content: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .dividend-mode-btn {
            min-height: 40px;
            padding: 0 16px;
            border-radius: 999px;
            border: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.11);
            color: white;
            cursor: pointer;
            font-size: 13px;
            font-weight: 900;
        }

        .dividend-mode-btn.active {
            background: #22c55e;
            color: #052e16;
            border-color: rgba(255, 255, 255, 0.35);
        }

        .info-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px;
            margin-bottom: 18px;
        }

        .info-pill {
            background: rgba(15, 23, 42, 0.56);
            border: 1px solid var(--border);
            border-radius: 18px;
            padding: 14px 16px;
            text-align: center;
            box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
        }

        .info-pill-label {
            font-size: 12px;
            color: var(--muted);
            margin-bottom: 6px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        .info-pill-value {
            font-size: 17px;
            font-weight: 900;
            color: var(--accent);
            font-variant-numeric: tabular-nums;
            line-height: 1;
            white-space: nowrap;
            display: flex;
            align-items: center;
            justify-content: center;
            will-change: opacity, transform, filter;
        }

        .reality-check {
            margin-top: 18px;
            background: linear-gradient(135deg, rgba(251, 197, 49, 0.12), rgba(56, 189, 248, 0.08));
            border: 1px solid var(--border);
            border-radius: 20px;
            padding: 18px 20px;
            line-height: 1.5;
            box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
        }

        .reality-check-title {
            font-size: 15px;
            font-weight: 900;
            color: var(--accent);
            margin-bottom: 8px;
        }

        .reality-check-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            flex-wrap: wrap;
            margin-bottom: 12px;
        }

        .reality-check-header .reality-check-title {
            margin-bottom: 0;
        }

        .reality-check-text {
            font-size: 14px;
            color: rgba(255, 255, 255, 0.92);
        }

        .reality-check-footer {
            margin-top: 12px;
            color: rgba(255, 255, 255, 0.48);
            font-size: 12px;
            line-height: 1.45;
        }

        .reality-mode-row {
            display: flex;
            justify-content: center;
            gap: 10px;
            flex-wrap: wrap;
            margin: 0;
        }

        .reality-mode-btn {
            padding: 9px 14px;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            background: rgba(255, 255, 255, 0.12);
            color: white;
            font-weight: bold;
            font-size: 13px;
            cursor: pointer;
        }

        .reality-mode-btn.active {
            background: #fbc531;
            color: #1e272e;
            border-color: rgba(255, 255, 255, 0.25);
        }

        .control-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
            min-width: 0;
            color: #abc7fff5;
        }

        label {
            font-weight: 800;
            font-size: 13px;
            color: rgba(255, 255, 255, 0.9);
        }

        input, select, button {
            padding: 12px 18px;
            border-radius: 14px;
            border: 1px solid transparent;
            background: var(--blue);
            color: white;
            cursor: pointer;
            font-weight: 800;
            font: inherit;
            touch-action: manipulation;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            user-select: none;
            transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
        }

        input[type="number"], select {
            background: #abc7fff5;
            color: #111827;
            cursor: text;
            border-color: rgba(255, 255, 255, 0.18);
        }

        input:focus, select:focus, button:focus-visible {
            outline: none;
            border-color: rgba(251, 197, 49, 0.78);
            box-shadow: 0 0 0 4px rgba(251, 197, 49, 0.16);
        }

        .primary-btn {
            min-height: 48px;
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.18);
            box-shadow: none;
        }

        .primary-btn:hover {
            background: rgba(255, 255, 255, 0.12);
            box-shadow: none;
        }

        button:hover {
            background: #0ea5e9;
            transform: translateY(-1px);
        }

        .period-buttons {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            margin: 0;
        }

        .period-btn {
            width: 44px;
            height: 40px;
            background: rgba(255, 255, 255, 0.11);
            border: 1px solid var(--border);
            border-radius: 999px;
            color: white;
            cursor: pointer;
            font-size: 18px;
            font-weight: 900;
            text-align: center;
            transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0;
        }

        .period-btn.active {
            background: var(--accent);
            color: #111827;
            border-color: rgba(255, 255, 255, 0.35);
        }

        .period-btn:hover {
            background: rgba(255, 255, 255, 0.22);
            transform: translateY(-1px);
        }

        .period-btn.active:hover {
            background: var(--accent-hover);
        }
        .period-display {
            min-width: 112px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            font-weight: 900;
            font-size: 14px;
            color: #111827;
            background: var(--accent);
            border: 1px solid rgba(255, 255, 255, 0.25);
            padding: 0 18px;
            border-radius: 999px;
            margin: 0;
            cursor: pointer;
            box-shadow: 0 10px 24px rgba(251, 197, 49, 0.18);
        }

        .period-selector {
            position: relative;
        }

        .period-dropdown {
            position: absolute;
            top: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            min-width: 140px;
            background: rgba(15, 23, 42, 0.96);
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 12px;
            box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
            padding: 8px;
            display: none;
            z-index: 1200;
            backdrop-filter: blur(10px);
        }

        .period-dropdown.show {
            display: grid;
        }

        .period-option {
            width: 100%;
            background: transparent;
            border: 1px solid transparent;
            color: white;
            text-align: center;
            border-radius: 10px;
            padding: 9px 10px;
            font-size: 13px;
            font-weight: bold;
            cursor: pointer;
            box-sizing: border-box;
        }

        .period-option:hover {
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.08);
        }

        .period-option.active {
            background: #fbc531;
            color: #1e272e;
        }

        .zoom-controls {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
            margin-bottom: 18px;
            padding: 0 14px;
            border-radius: 16px;
            background: transparent;
            border: none;
        }

        .zoom-btn {
            min-width: 176px;
            height: 40px;
            background: rgba(255, 255, 255, 0.11);
            border: 1px solid var(--border);
            border-radius: 999px;
            color: white;
            cursor: pointer;
            font-size: 14px;
            font-weight: 900;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 0 18px;
        }

        .zoom-btn:hover {
            background: rgba(255, 255, 255, 0.22);
            transform: translateY(-1px);
        }

        .zoom-hint {
            font-size: 13px;
            color: var(--muted);
            display: none;
            max-width: none;
            width: 100%;
            line-height: 1.4;
            text-align: center;
            white-space: nowrap;
        }

        .mobile-zoom-controls {
            display: none;
            margin: -4px 0 18px;
        }

        .chart-container {
            position: relative;
            height: 540px;
            margin-bottom: 30px;
            background: rgba(2, 6, 23, 0.64);
            padding: 20px;
            border-radius: 22px;
            border: 1px solid var(--border);
            overflow: hidden;
            touch-action: pan-x pan-y;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            user-select: none;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 40px rgba(0, 0, 0, 0.22);
        }

        .chart-container canvas {
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            user-select: none;
        }

        .selection-popup {
            position: fixed;
            z-index: 2000;
            min-width: 260px;
            max-width: 320px;
            background: rgba(15, 23, 42, 0.96);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 12px;
            padding: 14px 16px;
            box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
            pointer-events: none;
            display: none;
            backdrop-filter: blur(10px);
        }

        .selection-popup.show {
            display: block;
        }

        .selection-popup-title {
            font-size: 14px;
            font-weight: bold;
            color: #fbc531;
            margin-bottom: 10px;
        }

        .selection-popup-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 7px;
            font-size: 13px;
        }

        .selection-popup-row {
            display: flex;
            justify-content: space-between;
            gap: 12px;
        }

        .selection-popup-label {
            opacity: 0.78;
        }

        .selection-popup-value {
            font-weight: bold;
            text-align: right;
        }

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

        .stat-box {
            background: rgba(15, 23, 42, 0.56);
            padding: 22px;
            border-radius: 20px;
            border: 1px solid var(--border);
            text-align: center;
            box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
        }

        .stat-label {
            font-size: 13px;
            color: var(--muted);
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        .stat-value {
            font-size: clamp(22px, 2.55vw, 30px);
            font-weight: 950;
            color: var(--accent);
            letter-spacing: -0.55px;
            font-variant-numeric: tabular-nums;
            line-height: 1;
            white-space: nowrap;
            display: flex;
            align-items: center;
            justify-content: center;
            will-change: opacity, transform, filter;
        }

        #gainLoss {
            font-size: clamp(20px, 2.1vw, 26px);
            letter-spacing: -0.35px;
            line-height: 1.15;
        }
        .dividend-subtext {
            margin-top: 8px;
            font-size: 14px;
            color: #2ecc71;
            font-weight: bold;
            font-variant-numeric: tabular-nums;
            line-height: 1;
            white-space: nowrap;
            display: flex;
            align-items: center;
            justify-content: center;
            will-change: opacity, transform, filter;
        }

        .stat-char {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            height: 1em;
            line-height: 1;
            vertical-align: top;
        }

        .stat-char-number,
        .stat-char-roller {
            min-width: 0.56em;
        }

        .stat-char-static {
            transform: translateY(0);
        }

        .stat-char-roller {
            position: relative;
            height: 1em;
            overflow: hidden;
            transform: translateZ(0);
        }

        .stat-char-old,
        .stat-char-new {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            will-change: transform, opacity, filter;
        }

        .stat-char-old {
            animation: statDigitOld 0.791s cubic-bezier(0.16, 0.84, 0.24, 1) both;
        }

        .stat-char-new {
            animation: statDigitNew 0.791s cubic-bezier(0.16, 0.84, 0.24, 1) both;
        }

        .stat-char-fade {
            animation: statValueChange 0.791s cubic-bezier(0.16, 0.84, 0.24, 1);
        }

        @keyframes statDigitOld {
            from {
                opacity: 1;
                transform: translateY(0) scale(1);
                filter: blur(0);
            }

            to {
                opacity: 0;
                transform: translateY(105%) scale(0.98);
                filter: blur(2px);
            }
        }

        @keyframes statDigitNew {
            from {
                opacity: 0;
                transform: translateY(-105%) scale(0.98);
                filter: blur(2px);
            }

            55% {
                opacity: 1;
                transform: translateY(9%) scale(1.015);
                filter: blur(0);
            }

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

        @keyframes statValueChange {
            from {
                opacity: 0.45;
                transform: translateY(9px) scale(0.98);
                filter: blur(1.5px);
            }

            55% {
                opacity: 1;
                transform: translateY(-2px) scale(1.015);
                filter: blur(0);
            }

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

        .loading {
            text-align: center;
            padding: 18px;
            font-size: 15px;
            color: var(--muted);
        }

        .loading::before {
            content: "";
            width: 16px;
            height: 16px;
            border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, 0.28);
            border-top-color: var(--accent);
            display: inline-block;
            margin-right: 10px;
            vertical-align: -3px;
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        .status-banner {
            display: none;
            margin: 0 auto 20px auto;
            max-width: 1240px;
            padding: 12px 16px;
            border-radius: 16px;
            background: rgba(15, 23, 42, 0.72);
            border: 1px solid var(--border);
            color: white;
            font-size: 14px;
            backdrop-filter: blur(14px);
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
        }

        .status-banner.show {
            display: block;
        }

        .status-banner.error {
            border-color: rgba(231, 76, 60, 0.6);
            color: #ffb3b3;
        }

        .status-banner.success {
            border-color: rgba(46, 204, 113, 0.6);
            color: #b8ffd1;
        }

        .autocomplete-container {
            position: relative;
            width: 100%;
            flex: 1;
        }

        .stock-input {
            width: 100% !important;
            background: #abc7fff5 !important;
            color: #111827 !important;
            border-color: rgba(255, 255, 255, 0.18) !important;
        }

        .autocomplete-list {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            right: 0;
            background: rgba(255, 255, 255, 0.98);
            border: 1px solid rgba(56, 189, 248, 0.6);
            border-radius: 14px;
            max-height: 220px;
            overflow-y: auto;
            display: none;
            z-index: 1000;
            box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
        }

        .autocomplete-list.show {
            display: block;
        }

        .autocomplete-item {
            padding: 11px 15px;
            cursor: pointer;
            color: #111827;
            border-bottom: 1px solid rgba(15, 23, 42, 0.08);
        }

        .autocomplete-item:hover {
            background: rgba(56, 189, 248, 0.12);
        }

        .autocomplete-item-ticker {
            font-weight: 900;
            color: #0284c7;
        }

        .autocomplete-item-name {
            font-size: 12px;
            color: #666;
            margin-left: 5px;
        }

        .back-home-btn {
            position: fixed;
            top: 20px;
            left: -190px;
            z-index: 1002;
            background: #fbc531;
            color: #1e272e;
            border: none;
            border-radius: 0 14px 14px 0;
            padding: 14px 18px;
            font-weight: bold;
            text-decoration: none;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
            display: inline-flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            min-width: 200px;
            overflow: hidden;
            transition: left 0.28s ease, background 0.28s ease;
        }

        .back-home-btn:hover {
            left: 0;
            background: #fda502;
            color: #1e272e;
        }

        .back-home-btn-icon {
            font-size: 22px;
            line-height: 1;
            min-width: 24px;
            text-align: center;
            flex-shrink: 0;
            margin-left: auto;
            opacity: 1;
            transition: opacity 0.18s ease;
        }

        .back-home-btn-text {
            white-space: nowrap;
            font-size: 16px;
            opacity: 0;
            transform: translateX(-12px);
            transition: opacity 0.22s ease, transform 0.22s ease;
        }

        .back-home-btn:hover .back-home-btn-text {
            opacity: 1;
            transform: translateX(0);
        }
        .back-home-btn:hover .back-home-btn-icon {
            opacity: 0;
        }

        .graph-settings-btn {
            position: fixed;
            top: 18px;
            right: 18px;
            z-index: 1002;
            background: rgba(156, 136, 255, 0.92);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 14px;
            padding: 12px 16px;
            font-weight: 900;
            cursor: pointer;
            box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
            backdrop-filter: blur(12px);
        }

        .graph-settings-btn:hover {
            background: #8c7ae6;
        }

        .graph-settings-panel {
            position: fixed;
            top: 70px;
            right: 18px;
            width: 290px;
            background: rgba(15, 23, 42, 0.97);
            border: 1px solid var(--border);
            border-radius: 18px;
            padding: 18px;
            z-index: 1003;
            box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
            display: none;
            backdrop-filter: blur(16px);
        }

        .graph-settings-panel.show {
            display: block;
        }

        .graph-settings-title {
            font-size: 18px;
            font-weight: 900;
            color: var(--accent);
            margin-bottom: 14px;
        }

        .graph-toggle-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .graph-toggle-item {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 14px;
            cursor: pointer;
            padding: 10px;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.055);
        }

        .graph-toggle-item input[type="checkbox"] {
            width: 16px;
            height: 16px;
            cursor: pointer;
        }

        .app-footer {
            max-width: 1240px;
            margin: 18px auto 0 auto;
            text-align: center;
            color: rgba(255, 255, 255, 0.5);
            font-size: 12px;
            line-height: 1.5;
        }
        @media (max-width: 900px) {
            .container {
                margin-top: 24px;
            }
        }

        @media (max-width: 640px) {
            body {
                padding: 10px;
            }

            .container {
                margin-top: 20px;
                padding: 18px;
                border-radius: 20px;
            }

            .back-home-btn {
                top: 86px;
                left: -212px;
                min-width: 250px;
                padding: 12px 14px;
            }

            .back-home-btn-text {
                font-size: 14px;
            }

            .top-action-row {
                display: grid;
                grid-template-columns: 1fr;
                gap: 14px;
                padding: 14px;
            }

            .info-row {
                grid-template-columns: 1fr;
                margin-top: 6px;
            }

            .market-strip {
                margin-bottom: 18px;
                padding: 10px;
                border-radius: 16px;
            }

            .market-strip-label {
                font-size: 11px;
            }

            .market-ticker-btn {
                height: 34px;
                padding: 0 12px;
                font-size: 12px;
            }

            .controls {
                grid-template-columns: 1fr;
                gap: 14px;
                padding: 14px;
                margin-bottom: 20px;
                border-radius: 18px;
                overflow: hidden;
            }

            .control-group,
            .autocomplete-container {
                min-width: 0;
                width: 100%;
            }

            .controls input,
            .controls .primary-btn {
                width: 100%;
                min-width: 0;
            }

            .primary-btn {
                min-height: 46px;
            }

            .quick-amounts {
                display: grid;
                grid-template-columns: repeat(6, minmax(0, 1fr));
                width: 100%;
                gap: 10px;
            }

            .quick-amount-btn {
                grid-column: span 2;
                min-width: 0;
                width: 100%;
                height: 38px;
                padding: 0 10px;
                font-size: 13px;
            }

            .quick-amount-btn:nth-child(4) {
                grid-column: 1 / 4;
            }

            .quick-amount-btn:nth-child(5) {
                grid-column: 4 / 7;
            }

            .dividend-mode-row {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                width: 100%;
            }

            .dividend-mode-btn {
                width: 100%;
                padding: 0 10px;
                font-size: 12px;
            }

            .period-buttons {
                display: grid;
                grid-template-columns: minmax(112px, 1fr) 40px minmax(92px, 0.8fr) 40px;
                width: 100%;
                gap: 8px;
            }

            .zoom-btn {
                min-width: 0;
                width: 100%;
                height: 40px;
                padding: 0 10px;
                font-size: 12px;
                line-height: 1.05;
                white-space: normal;
            }

            .period-btn {
                width: 40px;
                height: 40px;
                font-size: 16px;
            }

            .period-display {
                min-width: 0;
                width: 100%;
                height: 40px;
                padding: 0 10px;
                font-size: 13px;
            }

            .zoom-hint {
                white-space: normal;
                text-align: center;
                padding: 0 2px;
                font-size: 12px;
            }

            .mobile-zoom-controls {
                display: none;
                width: 100%;
                grid-template-columns: repeat(4, minmax(0, 1fr));
                gap: 8px;
                margin: -2px 0 18px;
            }

            .mobile-zoom-controls.show {
                display: grid;
            }

            .mobile-zoom-btn {
                min-width: 0;
                height: 42px;
                padding: 0;
                border-radius: 14px;
                background: rgba(255, 255, 255, 0.11);
                border: 1px solid var(--border);
                color: white;
                font-size: 18px;
                font-weight: 950;
                box-shadow: none;
            }

            .mobile-zoom-btn:hover {
                background: rgba(255, 255, 255, 0.11);
                box-shadow: none;
            }

            .chart-container {
                width: calc(100% + 36px);
                margin-left: -18px;
                margin-right: -18px;
                height: 460px;
                padding: 12px 10px;
                border-left: 1px solid var(--border);
                border-right: 1px solid var(--border);
                border-radius: 16px;
                touch-action: none;
            }

            .chart-container canvas {
                touch-action: none;
            }

            .info-pill {
                padding: 13px 12px;
                border-radius: 14px;
            }

            .info-pill-label {
                font-size: 11px;
                letter-spacing: 0.07em;
            }

            .info-pill-value {
                font-size: 16px;
                max-width: 100%;
                overflow: hidden;
            }

            #visibleRangeInfo {
                font-size: 14px;
            }

            .info-pill-value .stat-char-number,
            .info-pill-value .stat-char-roller {
                min-width: 0.5em;
            }

            .reality-check-header {
                justify-content: center;
                text-align: center;
            }

            .reality-check-header .reality-check-title {
                width: 100%;
            }

            .reality-mode-row {
                width: 100%;
                justify-content: center;
                gap: 8px;
            }

            .reality-mode-btn {
                flex: 0 1 92px;
                padding: 9px 10px;
                text-align: center;
            }
        }

        .chart-container canvas {
            transition: opacity 0.24s ease, transform 0.24s ease, filter 0.24s ease;
            transform-origin: center center;
        }

        .chart-container.chart-data-loading canvas {
            opacity: 0.52;
            transform: scale(0.992) translateY(4px);
            filter: blur(1.5px) saturate(0.86);
        }

        .chart-container.chart-data-enter canvas {
            animation: chartDataEnter 0.58s cubic-bezier(0.2, 0.8, 0.2, 1);
        }

        .chart-container.mobile-chart-motion canvas {
            animation: mobileChartMotion 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
        }

        @keyframes chartDataEnter {
            from {
                opacity: 0.38;
                transform: scale(0.992) translateY(9px);
                filter: blur(2px) saturate(0.86);
            }

            to {
                opacity: 1;
                transform: scale(1) translateY(0);
                filter: blur(0) saturate(1);
            }
        }

        @keyframes mobileChartMotion {
            from {
                opacity: 0.82;
                transform: scale(0.996) translateY(2px);
                filter: blur(1px) saturate(0.92);
            }

            to {
                opacity: 1;
                transform: scale(1) translateY(0);
                filter: blur(0) saturate(1);
            }
        }

        .reality-check-text {
            position: relative;
            min-height: 1.5em;
            will-change: opacity, transform, filter;
        }

        .reality-text-exit {
            opacity: 0;
            transform: translateY(-8px) scale(0.99);
            filter: blur(2px);
            transition: opacity 0.16s ease, transform 0.16s ease, filter 0.16s ease;
        }

        .reality-text-enter {
            animation: realityTextEnter 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
        }

        @keyframes realityTextEnter {
            from {
                opacity: 0;
                transform: translateY(12px) scale(0.99);
                filter: blur(2px);
                text-shadow: 0 0 18px rgba(251, 197, 49, 0.42);
            }

            55% {
                text-shadow: 0 0 26px rgba(251, 197, 49, 0.34);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
                filter: blur(0);
                text-shadow: none;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            .chart-container canvas,
            .chart-container.chart-data-enter canvas,
            .chart-container.mobile-chart-motion canvas,
            .reality-text-exit,
            .reality-text-enter,
            .stat-value.stat-value-change,
            .dividend-subtext.stat-value-change,
            .stat-char-old,
            .stat-char-new,
            .stat-char-fade {
                animation: none;
                transition: none;
                transform: none;
                filter: none;
            }
        }
