        .timeline-labella-embed * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        .timeline-labella-embed {
            font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
            background: radial-gradient(circle at 10% 20%, #edf5ff, #d7e7f9 55%, #c8def6);
            min-height: 100vh;
            padding: 28px 16px;
            color: #18212f;
        }

        .timeline-labella-embed .container {
            max-width: 1600px;
            margin: 0 auto;
            background: #fefefe;
            border-radius: 14px;
            box-shadow: 0 20px 45px rgba(25, 42, 70, 0.18);
            padding: 26px;
            border: 1px solid #d5e2f2;
            position: relative;
        }

        .timeline-labella-embed h1 {
            text-align: center;
            color: #1c2e47;
            margin-bottom: 6px;
            font-size: 2.1rem;
        }

        .timeline-labella-embed .subtitle {
            text-align: center;
            color: #4c607c;
            margin-bottom: 18px;
            font-size: 1rem;
        }

        .timeline-labella-embed .timeline-wrapper {
            overflow-x: auto;
            border: 1px solid #dce7f5;
            border-radius: 10px;
            background:
                radial-gradient(circle, rgba(35, 74, 122, 0.14) 1px, transparent 1px),
                linear-gradient(to bottom, #f8fbff, #f1f7fe);
            background-size: 8px 8px, 100% 100%;
            padding: 16px;
            scroll-behavior: smooth;
            cursor: grab;
        }

        .timeline-labella-embed .timeline-wrapper.dragging {
            cursor: grabbing;
            -webkit-user-select: none;
            user-select: none;
        }

        .timeline-labella-embed .stats {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 16px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }

        .timeline-labella-embed .stats-pills {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
        }

        .timeline-labella-embed .stats-controls {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .timeline-labella-embed .icon-btn {
            width: 38px;
            min-width: 38px;
            padding: 0;
            font-size: 1rem;
            font-weight: 700;
        }

        .timeline-labella-embed .pill {
            background: #e7f0fb;
            color: #244466;
            border: 1px solid #bfd4ed;
            padding: 6px 12px;
            border-radius: 999px;
            font-size: 0.86rem;
            font-weight: 600;
        }

        .timeline-labella-embed .floating-panel {
            position: fixed;
            right: 18px;
            width: 240px;
            background: rgba(255, 255, 255, 0.95);
            -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
            border: 1px solid #cddcf0;
            border-radius: 10px;
            box-shadow: 0 10px 26px rgba(25, 42, 70, 0.2);
            z-index: 100;
            overflow: hidden;
            transition: top 0.2s ease;
        }

        .timeline-labella-embed .legend-panel {
            top: 20px;
        }

        .timeline-labella-embed .panel-head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 12px;
            background: #e7f0fb;
            border-bottom: 1px solid #cadbf1;
            color: #214364;
            font-weight: 700;
            font-size: 0.92rem;
        }

        .timeline-labella-embed .panel-toggle {
            border: 1px solid #aac2df;
            background: #ffffff;
            color: #244466;
            border-radius: 6px;
            width: 28px;
            height: 24px;
            cursor: pointer;
            font-weight: 700;
        }

        .timeline-labella-embed .panel-body {
            padding: 10px;
            max-height: 320px;
            overflow: auto;
        }

        .timeline-labella-embed .legend-panel .panel-body {
            max-height: none;
            overflow: visible;
        }

        .timeline-labella-embed .collapsed .panel-body {
            display: none;
        }

        .timeline-labella-embed .legend-list {
            display: grid;
            gap: 8px;
        }

        .timeline-labella-embed .legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            background: #f3f8fe;
            border: 1px solid #dae6f6;
            border-radius: 8px;
            padding: 7px 9px;
            font-size: 0.82rem;
            color: #2b4566;
            cursor: pointer;
            -webkit-user-select: none;
            user-select: none;
            transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
        }

        .timeline-labella-embed .legend-item:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 10px rgba(25, 42, 70, 0.12);
        }

        .timeline-labella-embed .legend-item.active {
            border-color: #5f89be;
            box-shadow: inset 0 0 0 1px #5f89be;
        }

        .timeline-labella-embed .legend-item.dimmed {
            opacity: 0.35;
        }

        .timeline-labella-embed .legend-swatch {
            width: 12px;
            height: 12px;
            border-radius: 2px;
            flex-shrink: 0;
        }

        .timeline-labella-embed svg {
            display: block;
        }

        .timeline-labella-embed .row-background {
            stroke: #d7e4f5;
            stroke-width: 1;
        }

        .timeline-labella-embed .group-header-background {
            fill: #edf4fc;
            stroke: #c6d7eb;
            stroke-width: 1;
        }

        .timeline-labella-embed .group-header-name {
            font-size: 12px;
            fill: #1f4368;
            font-weight: 700;
        }

        .timeline-labella-embed .group-toggle {
            cursor: pointer;
        }

        .timeline-labella-embed .group-toggle, .timeline-labella-embed .group-toggle * {
            pointer-events: all;
        }

        .timeline-labella-embed .group-toggle-bg {
            fill: #ffffff;
            stroke: #aac2df;
            stroke-width: 1;
        }

        .timeline-labella-embed .group-toggle-symbol {
            font-size: 11px;
            fill: #244466;
            font-weight: 700;
            pointer-events: none;
        }

        .timeline-labella-embed .axis-label {
            font-size: 12px;
            fill: #32527a;
            font-weight: 600;
        }

        .timeline-labella-embed .month-label {
            font-size: 10px;
            fill: #4c6484;
            font-weight: 600;
        }

        .timeline-labella-embed .month-start-dash {
            stroke: #4e6789;
            stroke-width: 1;
            opacity: 0.85;
        }

        .timeline-labella-embed .row-name {
            font-size: 12px;
            fill: #244466;
            font-weight: 700;
        }

        .timeline-labella-embed .row-name.dimmed {
            opacity: 0.14;
        }

        .timeline-labella-embed .row-guide {
            stroke: #95b4d8;
            stroke-width: 1;
            stroke-dasharray: 3 4;
            opacity: 0.65;
        }

        .timeline-labella-embed .event-link {
            fill: none;
            stroke-width: 2.2;
            opacity: 0.84;
            transition: opacity 0.2s ease, stroke 0.2s ease;
        }

        .timeline-labella-embed .event-connector,
        .timeline-labella-embed .hover-connector {
            pointer-events: none;
        }

        .timeline-labella-embed .hover-event-overlay {
            pointer-events: none;
        }

        .timeline-labella-embed .event-connector.dimmed {
            opacity: 0.14;
        }

        .timeline-labella-embed .event-dot {
            stroke: #ffffff;
            stroke-width: 1.8;
            cursor: pointer;
        }

        .timeline-labella-embed .event-label {
            cursor: pointer;
            transition: opacity 0.2s ease;
        }

        .timeline-labella-embed .event-label-bg {
            stroke-width: 1;
        }

        .timeline-labella-embed .event-label-text {
            font-size: 10px;
            fill: #10253d;
            pointer-events: none;
            font-weight: 600;
        }

        .timeline-labella-embed .special-year-line {
            stroke: #395f8d;
            stroke-width: 1.5;
            stroke-dasharray: 5 4;
            opacity: 0.7;
        }

        .timeline-labella-embed .special-year-line.adjacent-to-term {
            stroke: #173d68;
            stroke-width: 2.2;
            opacity: 0.95;
        }

        .timeline-labella-embed .term-highlight {
            fill: rgb(255, 255, 128);
            stroke: rgba(28, 69, 117, 0.35);
            stroke-width: 1;
        }

        .timeline-labella-embed .term-boundary {
            stroke: #173d68;
            stroke-width: 2.4;
            opacity: 0.95;
        }

        .timeline-labella-embed .special-year-label {
            font-size: 10px;
            fill: #2d4f75;
            font-weight: 700;
        }

        .timeline-labella-embed .row-group.dimmed {
            opacity: 0.14;
        }

        .timeline-labella-embed .row-group.highlight .event-link,
        .timeline-labella-embed .row-group.highlight .event-label,
        .timeline-labella-embed .row-group.highlight .event-dot {
            opacity: 1;
        }

        .timeline-labella-embed .controls-grid {
            display: grid;
            grid-template-columns: repeat(5, minmax(0, 1fr));
            gap: 8px;
            margin-bottom: 0;
        }

        .timeline-labella-embed .control-btn {
            border: 1px solid #aec6e3;
            background: #f4f9ff;
            color: #214364;
            border-radius: 7px;
            padding: 8px 8px;
            font-size: 1rem;
            line-height: 1;
            text-align: center;
            cursor: pointer;
            font-weight: 600;
        }

        .timeline-labella-embed .control-btn:hover {
            background: #e7f2ff;
        }

        .timeline-labella-embed .term-label {
            display: none;
            font-size: 0.82rem;
            color: #34597f;
            margin-bottom: 6px;
            font-weight: 700;
        }

        .timeline-labella-embed .term-select {
            width: 170px;
            border: 1px solid #aec6e3;
            border-radius: 7px;
            padding: 8px;
            background: #fff;
            color: #1e3d5c;
        }

        .timeline-labella-embed .tooltip {
            position: fixed;
            display: none;
            max-width: 300px;
            background: #ffffff;
            border-radius: 8px;
            border: 1px solid #b7cdea;
            box-shadow: 0 12px 24px rgba(23, 44, 70, 0.18);
            font-size: 12px;
            line-height: 1.45;
            z-index: 1000;
            overflow: hidden;
        }

        .timeline-labella-embed .tooltip-thumb {
            display: block;
            width: 100%;
            height: 126px;
            object-fit: cover;
            background: #d9e5f4;
        }

        .timeline-labella-embed .tooltip-body {
            padding: 10px 12px;
        }

        .timeline-labella-embed .tooltip-title {
            font-weight: 700;
            color: #173553;
            margin-bottom: 4px;
        }

        .timeline-labella-embed .tooltip-meta {
            color: #3d5d81;
            margin-bottom: 4px;
        }

        .timeline-labella-embed .error,
        .timeline-labella-error {
            background: #fff2f2;
            border: 1px solid #f4b4b4;
            color: #a12f2f;
            padding: 16px;
            border-radius: 8px;
        }

        @media (max-width: 768px) {
            .timeline-labella-embed .container {
                padding: 16px;
            }

            .timeline-labella-embed h1 {
                font-size: 1.55rem;
            }

            .timeline-labella-embed .timeline-wrapper {
                padding: 10px;
            }

            .timeline-labella-embed .floating-panel {
                position: static;
                width: 100%;
                margin-top: 12px;
            }

            .timeline-labella-embed .stats {
                flex-direction: column;
                align-items: stretch;
            }

            .timeline-labella-embed .stats-controls {
                width: 100%;
                justify-content: flex-end;
            }
        }
