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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #ffffff;
    color: #1f2937;
    line-height: 1.5;
    font-size: 16px;
}

/* Ensure font applies to all interactive elements */
input, button, select, textarea {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 8px 24px;
}

.page-layout {
    display: flex;
}

/* Tab Navigation with Title */
.tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.site-title {
    margin: 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.tab-buttons {
    display: flex;
    gap: 6px;
}

.tab {
    padding: 6px 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    transition: all 0.3s;
    outline: none;
}

.tab:hover {
    color: #6b7280;
}

.tab.active {
    color: #1f2937;
    border-bottom-color: #1f2937;
}

.tab-content {
    display: none;
}

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

/* Sub-tabs for Explore */
.sub-tabs {
    display: flex;
    gap: 6px;
    margin-top: -8px;
    margin-bottom: 12px;
    justify-content: flex-end;
}

.sub-tab {
    padding: 4px 10px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 13px;
    line-height: 18px;
    color: #6b7280;
    transition: all 0.3s;
}
.sub-tab-emoji {
    font-size: 13px;
    line-height: 18px;
    vertical-align: middle;
}

.sub-tab-emoji .emoji {
    font-size: 15px;
}

.sub-tab:hover {
    color: #6b7280;
}

.sub-tab.active {
    color: #1f2937;
    border-bottom-color: #1f2937;
}

.sub-tab-content {
    display: none;
}

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

/* Placeholder styling */
.placeholder-content {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.placeholder-content h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #6b7280;
}

.placeholder-content p {
    font-size: 14px;
}

/* Controls */
.controls {
    padding: 4px 0;
    margin-bottom: 12px;
}

.control-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
    align-items: flex-end;
}

.control {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.control label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.control input,
.control select {
    padding: 3px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    min-width: 100px;
    height: 28px;
    box-sizing: border-box;
}

#name-input-1 {
    max-width: 180px;
}

.control input:focus,
.control select:focus {
    outline: none;
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.sex-selector {
    display: flex;
    gap: 10px;
}

.sex-button {
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
}

.sex-button:hover {
    border-color: #6b7280;
}

.sex-button.active {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
}

.sex-button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Inline sex selector (below name input on desktop) */
.inline-sex-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.inline-sex-selector label {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
}

button.search-button {
    padding: 4px 16px;
    background: #6b7280;
    color: white;
    border: 1px solid #6b7280;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.3s;
    height: 28px;
    box-sizing: border-box;
}

button.search-button:hover {
    background: #4b5563;
}

button.surprise-button {
    padding: 0px 8px;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    height: 28px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

button.surprise-button:hover {
    background: #f3f4f6;
}

.name-input-spinning {
    animation: shuffle 0.08s steps(1) infinite;
}

.dice-icon {
    display: inline-block;
}

.dice-icon.spinning {
    animation: spin 0.2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chart + State Selector Row - side by side on desktop (legacy, kept for other uses) */
.chart-states-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
}

.chart-states-row .chart-container {
    flex: 1;
    min-width: 0;
}

/* State Selector Grid - 4 columns on desktop (right side of chart) */
.state-selector-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    flex-shrink: 0;
}

.state-selector-label {
    font-size: 10px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.state-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
}

.state-selector .state-tile {
    width: 26px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 2px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.15s;
    user-select: none;
}

.state-selector .state-tile:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.state-selector .state-tile.selected {
    background: var(--state-color);
    border-color: var(--state-color);
    color: white;
}

.state-selector .deselect-btn {
    grid-column: span 2;
    font-size: 9px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 2px;
    cursor: pointer;
    color: #6b7280;
}

.state-selector .deselect-btn:hover {
    background: #e5e7eb;
}

/* Rare names state selector - desktop only styles */
@media (min-width: 769px) {
    /* Horizontal layout like mobile */
    #state-selector-rare {
        grid-template-columns: repeat(13, auto);
        justify-content: start;
    }

    #state-selector-rare .deselect-btn {
        grid-column: span 2;
    }

    /* Left-justify the wrapper and match label to control labels */
    #rare-names .state-selector-wrapper {
        align-items: flex-start;
    }

    #rare-names .state-selector-label {
        font-size: 11px;
        font-weight: 500;
        color: #374151;
    }
}

/* Legacy state-map for heatmap only */
.state-map {
    position: relative;
    margin-bottom: 30px;
    max-width: 450px;
    height: 240px;
}

.state-map .state-tile {
    position: absolute;
    width: 22px;
    height: 25.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.3s;
    user-select: none;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.state-map .state-tile::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: #f3f4f6;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: -1;
}

.state-map .state-tile:hover {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}

.state-map .state-tile:hover::before {
    background: #e5e7eb;
}

.state-map .state-tile.selected {
    background: var(--state-color);
    color: white;
}

.state-map .state-tile.selected::before {
    background: var(--state-color);
}

/* Heatmap */
[id^="heatmap-section"] {
    margin-top: 5px;
}

[id^="heatmap-section"] h3 {
    margin: 0 0 20px 0;
    font-size: 11px;
    font-weight: 300;
    color: #9ca3af;
    text-transform: lowercase;
}

.heatmap-container {
    display: flex;
    justify-content: flex-start;
    position: relative;
}

.state-map.heatmap {
    height: 280px;
}

/* Position controls inside the heatmap */
.heatmap-container .heatmap-controls {
    position: absolute;
    top: 8px;
    left: 70px;
    width: 180px;
    z-index: 10;
}

.state-map.heatmap .state-tile {
    cursor: default;
    width: 32px;
    height: 37px;
    font-size: 10px;
    pointer-events: none;
    color: white;
    text-shadow: 0 0 3px rgba(0,0,0,0.7), 0 0 1px rgba(0,0,0,0.9);
}

.state-map.heatmap .state-tile::before {
    display: none;
}

.state-map.heatmap .state-tile {
    transition: background-color 0.45s ease;
}

/* Heatmap slider controls */
.heatmap-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.heatmap-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    outline: none;
}

.heatmap-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #6b7280;
    border-radius: 50%;
    cursor: pointer;
}

.heatmap-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #6b7280;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.heatmap-year-display {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    min-width: 35px;
    text-align: center;
}

.heatmap-play-btn {
    background: none;
    border: none;
    padding: 2px 4px;
    cursor: pointer;
    font-size: 10px;
    color: #9ca3af;
}

.heatmap-play-btn:hover {
    color: #6b7280;
}

.heatmap-play-btn.playing {
    color: #374151;
}

/* Site credit footer */
.site-credit {
    text-align: center;
    font-size: 11px;
    color: #b0b7c0;
    padding: 20px 0;
    margin-top: 30px;
}

.site-credit a {
    color: #b0b7c0;
    text-decoration: underline;
}

.site-credit a:hover {
    color: #9ca3af;
}

/* Feedback modal */
.feedback-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.feedback-modal-overlay.active {
    display: flex;
}

.feedback-modal {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.feedback-modal h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #1f2937;
}

.feedback-modal textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
}

.feedback-modal textarea:focus {
    outline: none;
    border-color: #6b7280;
}

.feedback-modal input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}

.feedback-modal input[type="email"]:focus {
    outline: none;
    border-color: #6b7280;
}

.feedback-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.feedback-modal button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.feedback-cancel {
    background: none;
    border: 1px solid #d1d5db;
    color: #6b7280;
}

.feedback-cancel:hover {
    background: #f3f4f6;
}

.feedback-submit {
    background: #1f2937;
    border: none;
    color: white;
}

.feedback-submit:hover {
    background: #374151;
}

.feedback-submit:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.feedback-success {
    color: #16a34a;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

.feedback-error {
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 12px;
}

/* Name explorer layout */
.name-comparison {
    display: block;
}

.name-column {
    min-width: 0;
}

/* Side-by-side layout for chart and heatmap */
.chart-heatmap-row {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.chart-heatmap-row .chart-container,
.chart-heatmap-row [id^="heatmap-section"] {
    flex: 1 1 0;
    min-width: 0;
    margin-top: 0;
}

/* Chart */
.chart-container {
    padding: 10px 10px 0 10px;
}

.chart-container.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #9ca3af;
    font-size: 14px;
}

.chart-container.loading::after {
    content: 'Loading...';
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.state-selector-wrapper.hidden-until-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.state-selector-wrapper.visible {
    opacity: 1;
}

.chart-title {
    font-size: 11px;
    font-weight: 300;
    color: #9ca3af;
}

.metric-toggle {
    display: flex;
    gap: 8px;
}

.metric-button {
    padding: 6px 16px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    color: #6b7280;
    transition: all 0.3s;
}

.metric-button:hover {
    border-color: #6b7280;
    color: #6b7280;
}

.metric-button.active {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
}

.metric-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.metric-button:disabled:hover {
    border-color: #d1d5db;
    color: #6b7280;
}

.axis path,
.axis line {
    stroke: #d1d5db;
}

.axis text {
    fill: #6b7280;
    font-size: 12px;
}

.line {
    fill: none;
    stroke-width: 2;
}

.legend-item {
    cursor: pointer;
}

.legend-item text {
    font-size: 12px;
}

/* Similar Names (inside name-info) */
.similar-names-container {
    font-size: 11px;
    color: #6b21a8;
    line-height: 1.6;
}

.similar-name-btn {
    display: inline-block;
    padding: 1px 5px;
    background: white;
    border: none;
    border-radius: 3px;
    margin: 1px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 11px;
    color: #6b21a8;
    font-family: inherit;
}

.similar-name-btn:hover {
    background: #f3e8ff;
}

/* Name card loading state - show clean empty box with just "Loading..." */
.name-card.loading .name-card-header,
.name-card.loading .plot-options-collapse,
.name-card.loading .name-info-section,
.name-card.loading .prediction-details {
    display: none;
}

/* Unified Name Card */
.name-card {
    margin: 12px 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border: 1px solid #e9d5ff;
    border-radius: 10px;
    overflow: visible;
}

.name-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.name-card-prediction {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.prediction-icon {
    font-size: 14px;
}

.prediction-text {
    font-size: 14px;
    font-weight: 400;
    color: #6b21a8;
}

.prediction-forecast::before {
    content: ' · ';
}

.name-card-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.name-card-body {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    overflow: visible;
}

.name-card-body .chart-container {
    flex: 1;
    min-width: 0;
    padding: 0;
    overflow: visible;
}

/* Collapsible sections */
.toggle-arrow {
    font-size: 10px;
    transition: transform 0.2s;
    display: inline-block;
}

.toggle-arrow.expanded {
    transform: rotate(90deg);
}

/* Plot options (state + sex) */
.plot-options-collapse {
    margin-top: -12px;
}

.plot-options-toggle {
    background: none;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    font-size: 10px;
    color: #9ca3af;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
    margin-left: auto;
}

.plot-options-toggle:hover {
    color: #6b7280;
}

.plot-options-wrapper {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.plot-options-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.plot-options-label {
    font-size: 11px;
    color: #9ca3af;
    min-width: 40px;
    padding-top: 4px;
}

.plot-options-collapse .state-selector {
    grid-template-columns: repeat(13, auto);
    justify-content: flex-start;
}

.plot-options-collapse .sex-selector {
    display: flex;
    gap: 2px;
}

.plot-options-collapse .sex-selector .sex-button {
    min-width: 26px;
    height: 18px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 2px;
    cursor: pointer;
    font-size: 9px;
    color: #374151;
    transition: all 0.15s;
}

.plot-options-collapse .sex-selector .sex-button:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.plot-options-collapse .sex-selector .sex-button.active {
    background: #6b7280;
    border-color: #6b7280;
    color: white;
}

.plot-options-collapse .metric-toggle {
    display: flex;
    gap: 2px;
}

.plot-options-collapse .metric-toggle .metric-button {
    min-width: 26px;
    height: 18px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 2px;
    cursor: pointer;
    font-size: 9px;
    color: #374151;
    transition: all 0.15s;
}

.plot-options-collapse .metric-toggle .metric-button:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.plot-options-collapse .metric-toggle .metric-button.active {
    background: #6b7280;
    border-color: #6b7280;
    color: white;
}

/* Name info section */
.name-info-section {
    margin-top: 10px;
}

.name-info-wrapper {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.name-info-row {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
}

.name-info-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.name-info-icon {
    font-size: 14px;
}

.name-info-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b21a8;
}

.name-card .prediction-details {
    font-size: 10px;
    color: #7c3aed;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(147, 51, 234, 0.15);
}

.prediction-details .trend-up {
    color: #16a34a;
}

.prediction-details .trend-down {
    color: #dc2626;
}

.prediction-details .trend-stable {
    color: #6b7280;
}

.prediction-pct {
    font-weight: 400;
    font-size: 14px;
}

.prediction-pct .trend-up {
    color: #16a34a;
}

.prediction-pct .trend-down {
    color: #dc2626;
}

.name-card-btn {
    background: white;
    border: 1px solid #d8b4fe;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #9333ea;
    font-size: 10px;
}
.name-card-btn:hover {
    background: #f3e8ff;
    border-color: #c084fc;
    color: #7c3aed;
}
.name-card-btn svg {
    display: block;
}

/* Name Family (inside name-info) */
.family-stats {
    font-size: 11px;
    color: #7c3aed;
    margin-bottom: 6px;
}

.family-members {
    font-size: 11px;
    color: #6b21a8;
    line-height: 1.6;
}

.family-member {
    display: inline-block;
    padding: 1px 5px;
    background: white;
    border-radius: 3px;
    margin: 1px;
    cursor: pointer;
    transition: background 0.2s;
}

.family-member:hover {
    background: #f3e8ff;
}

.family-member.canonical {
    font-weight: 600;
    background: #e9d5ff;
}

.family-member.canonical:hover {
    background: #d8b4fe;
}

/* Unisex / Sex Balance (inside name-info) */
.unisex-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.unisex-chart-container {
    flex: 1;
    max-width: 400px;
}

.unisex-chart {
    height: 50px;
    display: flex;
    align-items: stretch;
    gap: 1px;
}

.unisex-year-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #9ca3af;
    margin-top: 4px;
}

.unisex-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
}

.unisex-stats .stat-value {
    color: #7c3aed;
}

.unisex-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 4px;
}

.unisex-stats-mobile {
    display: none;
    gap: 12px;
    font-size: 11px;
    color: #6b7280;
}

.unisex-stats-mobile .stat-value {
    color: #7c3aed;
}

.unisex-stats-mobile .stat-item-mobile {
    line-height: 1.4;
}

.unisex-legend {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #6b7280;
}

/* Starters */
.presets-section {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.presets-label {
    font-size: 10px;
    color: #9ca3af;
}

.preset-btn {
    padding: 3px 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 10px;
    color: #6b7280;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

/* Rare Names Results */
.results-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 20px;
}

/* Blog Container */
.blog-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 12px;
    line-height: 1.5;
    font-size: 12px;
}

.blog-loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 12px;
}

/* Blog Post Article */
.blog-post {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.blog-post:last-child {
    margin-bottom: 0;
}

.blog-post-header {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.blog-post-header-text {
    flex: 1;
}

.blog-share-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-family: inherit;
    transition: all 0.2s;
    flex-shrink: 0;
}

.blog-share-btn:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.blog-share-btn svg {
    width: 12px;
    height: 12px;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

.blog-post-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.blog-post-date {
    font-size: 11px;
    color: #6b7280;
    font-style: italic;
}

.blog-post-preview {
    color: #4b5563;
    font-size: 12px;
}

.blog-read-more {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    font-size: 11px;
    padding: 4px 0;
    text-decoration: underline;
}

.blog-read-more:hover {
    color: #1d4ed8;
}

/* Clickable name links in blog posts */
.blog-name-link {
    color: #7c3aed;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dashed #7c3aed;
    cursor: pointer;
    transition: all 0.2s;
}

.blog-name-link:hover {
    color: #5b21b6;
    border-bottom-style: solid;
}

/* Blog chart container */
#chart-blog {
    margin: 16px 0;
    min-height: 320px;
}

/* Blog Post Full Content Styling */
.blog-post-full {
    color: #374151;
    font-size: 12px;
}

.blog-post-full h1 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.blog-post-full h2 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 20px 0 10px 0;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.blog-post-full h3 {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 16px 0 8px 0;
}

.blog-post-full p {
    margin-bottom: 10px;
    color: #4b5563;
    font-size: 12px;
}

.blog-post-full hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

.blog-post-full strong {
    color: #1f2937;
}

.blog-post-full a {
    color: #3b82f6;
    text-decoration: none;
}

.blog-post-full a:hover {
    text-decoration: underline;
}

/* Superscript references */
.blog-post-full sup {
    font-size: 9px;
    line-height: 0;
}

.blog-post-full sup a {
    color: #3b82f6;
    text-decoration: none;
}

/* Blog images/figures - responsive */
.blog-post-full img,
.blog-figure img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 12px auto;
    border-radius: 4px;
}

.blog-figure {
    margin: 16px 0;
    text-align: center;
}

/* Blog leaders/laggards table */
.blog-table-container {
    margin: 20px 0;
    overflow-x: auto;
}

.blog-table-container {
    margin: 12px 0;
    display: flex;
    justify-content: center;
}

.blog-leaders-table {
    border-collapse: collapse;
    font-size: 12px;
    width: auto;
}

.blog-leaders-table th,
.blog-leaders-table td {
    padding: 4px 10px;
    border-bottom: 1px solid #e5e7eb;
}

.blog-leaders-table th:nth-child(1),
.blog-leaders-table td:nth-child(1),
.blog-leaders-table th:nth-child(3),
.blog-leaders-table td:nth-child(3) {
    text-align: left;
}

.blog-leaders-table th:nth-child(2),
.blog-leaders-table td:nth-child(2),
.blog-leaders-table th:nth-child(4),
.blog-leaders-table td:nth-child(4) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.blog-leaders-table thead tr:first-child th {
    border-bottom: none;
    padding-bottom: 2px;
    text-align: center;
}

.blog-leaders-table .leader-header {
    color: #1a9850;
    font-weight: 600;
}

.blog-leaders-table .laggard-header {
    color: #d73027;
    font-weight: 600;
}

.blog-leaders-table thead tr:nth-child(2) th {
    font-weight: 500;
    color: #6b7280;
    font-size: 10px;
}

.blog-leaders-table tbody tr:hover {
    background: #f9fafb;
}

/* Blog output (printed tables, etc.) */
.blog-output {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 10px;
    margin: 12px 0;
    overflow-x: auto;
}

.blog-output pre {
    margin: 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 10px;
    line-height: 1.4;
    white-space: pre;
    color: #374151;
}

/* References section */
.blog-post-full p[id^="ref"] {
    font-size: 10px;
    color: #6b7280;
    margin-bottom: 8px;
    padding-left: 18px;
    text-indent: -18px;
}

/* Lists */
.blog-post-full ul,
.blog-post-full ol {
    margin: 10px 0;
    padding-left: 20px;
}

.blog-post-full li {
    margin-bottom: 6px;
    color: #4b5563;
    font-size: 12px;
}

.state-column {
    flex: 0 0 200px;
    padding: 8px;
}

.state-image {
    width: 100%;
    height: 120px;
    border-radius: 6px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.state-column h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #6b7280;
    font-size: 13px;
}

.name-list {
    list-style: none;
}

.name-item {
    margin-bottom: 6px;
}

.clickable-name {
    cursor: pointer;
    padding: 4px 8px;
    margin: 2px -8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.clickable-name:hover {
    background-color: #f3f4f6;
}

.clickable-name:hover .name-text {
    color: #2563eb;
}

.name-text {
    font-weight: 500;
    color: #1f2937;
}

.year-label {
    font-size: 12px;
    color: #6b7280;
    margin-left: 5px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.loading-dots::after {
    content: '';
    animation: ellipsis 0.5s infinite steps(1);
}

@keyframes ellipsis {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 8px;
    border-radius: 6px;
    margin: 20px 0;
}

/* Main Content Layout */
.main-content {
    flex: 1;
    min-width: 0;
}

#less-gendered .controls {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}
#less-gendered .unisex-or-divider {
    padding-bottom: 4px;
}

#less-gendered #unisex-results {
    width: 100%;
    display: block;
}

/* Mobile Splash Screen */
.mobile-splash {
    display: none; /* Hidden by default, shown via media query on mobile */
}

/* Responsive */
@media (max-width: 968px) {
    /* Smooth scrolling fixes for mobile */
    html, body {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    /* GPU acceleration for smoother scrolling */
    .name-card,
    .name-info-wrapper,
    .plot-options-wrapper,
    .chart-container {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    /* Style inline sex selector for mobile */
    .inline-sex-selector {
        margin-top: 6px;
        justify-content: center;
    }

    /* Mobile Splash Screen */
    .mobile-splash {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff;
        z-index: 9999;
        justify-content: center !important;
        align-items: center !important;
    }

    .mobile-splash.hidden {
        display: none !important;
    }

    .splash-content {
        width: 380px;
        padding: 20px;
        text-align: center;
        box-sizing: border-box;
        margin: 0;
    }

    .splash-title {
        font-size: 3rem;
        margin-bottom: 8px;
        color: #1f2937;
        text-align: center;
    }

    .splash-subtitle {
        font-size: 1.4rem;
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 40px;
        text-align: center;
        white-space: nowrap;
    }

    .splash-control {
        margin-bottom: 24px;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }

    .splash-control label {
        display: block;
        font-size: 14px;
        font-weight: 500;
        color: #374151;
        margin-bottom: 8px;
        text-align: center;
    }

    .splash-control input {
        width: 240px;
        padding: 12px 16px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        font-size: 16px;
        font-family: inherit;
        text-align: center;
        box-sizing: border-box;
        margin: 0;
    }

    .splash-control input:focus {
        outline: none;
        border-color: #6b7280;
    }

    .splash-control input.prefilled {
        color: #9ca3af;
    }

    .splash-control .sex-selector {
        display: flex;
        gap: 12px;
        justify-content: center;
    }

    .splash-control .sex-button {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* Hide sex selector on mobile splash - defaults to 'both' */
    .splash-sex-control {
        display: none;
    }

    .splash-go-button {
        width: 240px;
        padding: 14px;
        background: #6b7280;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 500;
        cursor: pointer;
        font-family: inherit;
        margin-top: 16px;
    }

    .splash-go-button:hover {
        background: #4b5563;
    }

    .splash-randomize-button {
        padding: 8px 16px;
        background: none;
        color: #9ca3af;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        font-size: 12px;
        cursor: pointer;
        font-family: inherit;
        margin-top: 10px;
    }

    .splash-randomize-button:hover {
        color: #6b7280;
        border-color: #9ca3af;
    }

    .splash-randomize-button .dice-icon,
    .surprise-button .dice-icon {
        display: inline-block;
    }

    .dice-icon.spinning {
        animation: spin 0.2s linear infinite;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    .container {
        padding: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .tabs {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .site-title {
        text-align: center;
        order: -1;
        font-size: 18px;
    }

    .tab-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    .tab {
        padding: 6px 10px;
        font-size: 13px;
    }

    .sub-tabs {
        justify-content: center;
        margin-top: -4px;
        margin-bottom: 8px;
    }

    .sub-tab {
        font-size: 12px;
        padding: 3px 8px;
        line-height: 18px;
    }
    .sub-tab-emoji {
        font-size: 12px;
        line-height: 18px;
    }

    .sub-tab-emoji .emoji {
        font-size: 14px;
    }

    [data-subtab="rare-names"] .emoji,
    [data-subtab="less-gendered"] .emoji {
        font-size: 13px;
    }

    /* Reorder sections on mobile */
    .name-column {
        display: flex;
        flex-direction: column;
        contain: layout style;
    }

    .name-column .controls { order: 1; }
    .name-column .name-card { order: 2; }

    /* Unified name card mobile styles */
    .name-card {
        padding: 10px 6px;
    }

    .name-card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 0 4px;
    }

    .name-card-body .chart-container {
        padding: 0;
        background: transparent;
        margin: 0;
        width: 100%;
    }

    .name-card-body .chart-container svg {
        overflow: visible;
    }

    .plot-options-collapse {
        padding: 0 4px;
        margin-top: -4px;
    }

    .plot-options-collapse .state-selector {
        grid-template-columns: repeat(10, auto);
        justify-content: center;
    }

    .plot-options-collapse .sex-selector {
        justify-content: center;
    }

    .plot-options-row {
        flex-direction: column;
        gap: 6px;
    }

    .plot-options-label {
        min-width: unset;
        padding-top: 0;
    }

    .name-info-section {
        padding: 0 4px;
        margin-top: 4px;
    }

    .name-info-row {
        padding: 8px 10px;
    }

    /* Compact state selector for mobile */
    .state-selector {
        grid-template-columns: repeat(10, auto);
    }

    /* Stack chart and heatmap on mobile */
    .chart-heatmap-row {
        display: contents;
    }

    .name-column [id^="heatmap-section"] { order: 8; }

    .site-credit {
        margin-top: 40px;
        padding-bottom: 30px;
    }

    .chart-container {
        width: 100%;
        max-width: 100%;
        padding: 0;
        box-sizing: border-box;
        overflow: visible;
    }

    .chart-container svg {
        max-width: 100%;
        height: auto;
        overflow: visible;
    }

    .name-comparison {
        width: 100%;
        max-width: 100%;
    }

    .name-column {
        width: 100%;
        max-width: 100%;
    }

    .heatmap-container {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }

    .state-map.heatmap {
        transform: scale(0.85);
        transform-origin: top left;
        margin-bottom: -46px;
    }

    .state-map {
        height: 220px;
    }

    .state-tile {
        font-size: 8px;
    }

    .controls {
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 0;
    }

    .control-group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        box-sizing: border-box;
    }

    .control {
        width: 100%;
        box-sizing: border-box;
    }

    .control input,
    .control select {
        width: 100%;
        box-sizing: border-box;
    }

    /* Keep name input and go button on one row */
    .name-column .controls {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .name-column .control-group {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-end;
        gap: 8px;
        justify-content: center;
    }

    .name-column .control-group .control {
        flex: 0 0 auto;
        width: auto;
    }

    .name-column .control-group .control input {
        width: 140px;
        box-sizing: border-box;
    }

    .name-column .control-group .search-button,
    .name-column .control-group .surprise-button {
        flex: 0 0 auto;
        align-self: flex-end;
    }

    /* Stack chart and heatmap on mobile */
    .chart-heatmap-row {
        display: contents;
    }

    .chart-heatmap-row [id^="heatmap-section"] {
        margin-top: 15px;
    }

    /* Reorder sections on mobile */
    .name-column {
        display: flex;
        flex-direction: column;
        contain: layout style;
    }

    .name-column .controls { order: 1; }
    .name-column .name-card { order: 2; }
    .name-column [id^="heatmap-section"] { order: 3; }

    /* Full width unisex chart on mobile */
    .name-info-row .unisex-chart,
    .name-info-row .unisex-year-labels {
        max-width: 100%;
        width: 100%;
    }

    .unisex-content {
        flex-direction: column;
        gap: 10px;
    }

    .unisex-chart-container {
        max-width: 100%;
        width: 100%;
    }

    .unisex-stats {
        display: none;
    }

    .unisex-footer {
        flex-wrap: wrap;
        gap: 8px 12px;
        align-items: flex-start;
    }

    .unisex-stats-mobile {
        display: contents;
    }

    .stat-item-mobile {
        font-size: 9px;
        line-height: 1.3;
        color: #6b7280;
    }

    .stat-item-mobile .stat-value {
        color: #0369a1;
    }

    .unisex-legend {
        font-size: 10px;
    }

    /* Prediction text wrapping on mobile */
    .name-card-prediction {
        flex-wrap: wrap;
    }

    .prediction-pct {
        font-size: 14px;
        display: block;
        width: 100%;
        margin-top: 2px;
    }

    .prediction-pct-dot {
        display: none;
    }

    /* Compact rare names tab for mobile */
    #rare-names .controls {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #rare-names .control-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        align-items: flex-end;
        justify-content: center;
    }

    #rare-names .control {
        flex: 0 0 auto;
        width: auto;
    }

    #rare-names .control select {
        width: auto;
        min-width: 70px;
    }

    #rare-names .control label {
        font-size: 10px;
    }

    /* Compact unisex names tab for mobile */
    #less-gendered .controls {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    #less-gendered .control-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        align-items: flex-end;
        justify-content: center;
    }

    #less-gendered .control {
        flex: 0 0 auto;
        width: auto;
    }

    #less-gendered .control select,
    #less-gendered .control input {
        width: auto;
        min-width: 70px;
    }

    #less-gendered .control label {
        font-size: 10px;
    }

    #less-gendered .unisex-or-divider {
        text-align: center;
        margin: 0;
    }
    #less-gendered .control-group:last-child {
        margin-top: 0;
    }

    .results-container {
        gap: 6px;
        padding-bottom: 10px;
    }

    /* Center explore subtab descriptions on mobile */
    .hot-description,
    .cold-description,
    .rare-description,
    .unisex-description {
        text-align: center;
    }

    /* Hot names mobile styles */
    #hot-coming .controls {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #hot-coming .inline-sex-selector {
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .hot-name-card {
        padding: 12px;
    }

    .hot-name-stats {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    /* Blog mobile styles */
    .blog-container {
        padding: 10px;
        font-size: 11px;
    }

    .blog-post-title {
        font-size: 14px;
    }

    .blog-post-full h1 {
        font-size: 14px;
    }

    .blog-post-full h2 {
        font-size: 12px;
        margin: 16px 0 8px 0;
        padding-top: 8px;
    }

    .blog-post-full h3 {
        font-size: 11px;
    }

    .blog-post-full p {
        font-size: 11px;
    }

    .blog-post-full li {
        font-size: 11px;
    }

    .blog-output {
        padding: 8px;
    }

    .blog-output pre {
        font-size: 9px;
    }

    .blog-leaders-table {
        font-size: 10px;
    }

    .blog-leaders-table th,
    .blog-leaders-table td {
        padding: 3px 6px;
    }

    .blog-leaders-table thead tr:nth-child(2) th {
        font-size: 9px;
    }

    .blog-post-full p[id^="ref"] {
        font-size: 9px;
    }

    .state-column {
        flex: 0 0 calc(50% - 6px);
        padding: 4px;
    }

    .state-image {
        height: 60px;
        margin-bottom: 4px;
        padding: 8px;
        border-radius: 4px;
    }

    .state-column h3 {
        margin-bottom: 6px;
        font-size: 11px;
    }

    .name-item {
        margin-bottom: 2px;
    }

    .clickable-name {
        padding: 2px 6px;
        margin: 1px -6px;
    }

    .name-text {
        font-size: 12px;
    }

    .year-label {
        font-size: 10px;
    }
}

/* Leaderboard Tab Styles */
.leaderboard-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}
.leaderboard-sex-selector {
    display: none; /* Hidden on desktop - we show all three columns */
    gap: 10px;
}
.leaderboard-sex-selector .sex-button {
    padding: 3px 10px;
    font-size: 10px;
}
.leaderboard-slider-container {
    position: relative;
    width: 90%;
    max-width: 500px;
    margin: 4px auto 0;
}
.leaderboard-year-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 4px;
}
.year-arrow-btn {
    background: transparent;
    border: none;
    font-size: 12px;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 6px;
    transition: color 0.2s;
}
.year-arrow-btn:hover {
    color: #6b7280;
}
.year-arrow-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.leaderboard-play-btn {
    background: none;
    border: none;
    font-size: 10px;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 6px;
    margin-right: 8px;
    transition: color 0.2s;
}
.leaderboard-play-btn:hover {
    color: #6b7280;
}
.leaderboard-slider-label {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    min-width: 44px;
    text-align: center;
}
.leaderboard-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.leaderboard-slider-end {
    font-size: 10px;
    color: #9ca3af;
    flex-shrink: 0;
}
.leaderboard-slider {
    flex: 1;
    width: 100%;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(
        to right,
        #e5e7eb 0%,
        #e5e7eb 92%,
        transparent 92%
    ),
    repeating-linear-gradient(
        90deg,
        #d1d5db 0px,
        #d1d5db 2px,
        transparent 2px,
        transparent 5px
    );
    background-size: 100% 4px;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 2px;
    cursor: pointer;
    margin: 0;
}
.leaderboard-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #9ca3af;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.leaderboard-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #9ca3af;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.leaderboard-predicted {
    font-size: 8px;
    color: #9ca3af;
    opacity: 0;
    transition: opacity 0.3s;
    height: 6px;
    line-height: 6px;
}
.leaderboard-predicted.visible {
    opacity: 1;
}
/* Desktop: Three-column layout */
.leaderboard-desktop {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.leaderboard-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.leaderboard-column-header {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
}
.leaderboard-mobile {
    display: none; /* Hidden on desktop */
}
.year-nav-arrow {
    display: none; /* Hidden on desktop */
}
.leaderboard-grid {
    position: relative;
    min-width: 160px;
    max-width: 180px;
    height: 650px; /* 25 tiles * 26px each */
    touch-action: pan-y; /* Allow vertical scroll, horizontal handled by JS */
}
/* You Tab - Splash (initial centered form) */
.you-splash {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    padding: 40px 20px;
}
.you-splash-content {
    text-align: center;
    max-width: 400px;
    width: 100%;
}
.you-splash-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 28px;
}
.you-splash-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}
.you-splash-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}
.you-splash-field label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}
.you-splash-field input, .you-splash-field select {
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    height: 42px;
    width: 100%;
    background: #fff;
}
.you-splash-field input:focus, .you-splash-field select:focus {
    outline: none;
    border-color: #9ca3af;
}
.you-splash-go {
    height: 42px;
    padding: 0 32px;
    font-size: 15px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.you-splash-footnote {
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
}

/* You Tab - Inline form (after first search) */
.you-form {
    margin-bottom: 16px;
}
.you-form-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.you-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.you-field label {
    font-size: 10px;
    color: #6b7280;
    font-weight: 500;
    text-transform: lowercase;
}
.you-field input, .you-field select {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    height: 28px;
}
.you-field input[type="number"] {
    width: 80px;
}
.you-field input[type="text"] {
    width: 140px;
}
.you-field select {
    width: 120px;
}
.you-go-button {
    height: 28px;
    padding: 0 16px;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.you-summary {
    font-size: 14px;
    color: #374151;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}
.you-summary strong {
    color: #1f2937;
}
.you-chart-card {
    margin-bottom: 16px;
}
.you-chart-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}
.you-lists {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}
.you-list-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.you-list-header {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: lowercase;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e5e7eb;
}
.you-list-grid {
    display: flex;
    flex-direction: column;
    gap: 3px;
    height: 310px;
    overflow-y: scroll;
    padding-right: 4px;
    flex-shrink: 0;
}
.you-tile {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    height: 28px;
    font-size: 11px;
}
.you-tile:hover {
    border-color: #d4d4d4;
    background: #fafafa;
}
.you-tile.active {
    border-color: #9ca3af;
    background: #f3f4f6;
}
.you-tile.highlighted {
    border-color: #3b82f6;
    background: #eff6ff;
    font-weight: 600;
}
.you-tile .rank {
    font-size: 10px;
    color: #6b7280;
    font-weight: 600;
    min-width: 36px;
    flex-shrink: 0;
    margin-right: 4px;
}
.you-tile .name {
    font-weight: 500;
    color: #1f2937;
    flex: 1;
}
.you-tile .count {
    font-size: 10px;
    color: #9ca3af;
}
.you-tile .swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 6px;
    flex-shrink: 0;
}

/* Hide metric toggle on you tab — always use percentage */
.you-chart-header {
    display: none;
}

@media (max-width: 768px) {
    .you-form-row {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 6px;
    }
    .you-field {
        flex: 1;
        min-width: 0;
    }
    .you-field input[type="text"],
    .you-field input[type="number"],
    .you-field select {
        width: 100%;
    }
    .you-go-button {
        width: 100%;
        justify-content: center;
    }
    .you-lists {
        flex-direction: row;
        gap: 8px;
    }
    .you-list-header {
        font-size: 10px;
    }
    .you-tile {
        padding: 3px 6px;
        font-size: 10px;
        height: 24px;
    }
    .you-tile .rank {
        font-size: 9px;
        min-width: 22px;
    }
    .you-tile .count {
        font-size: 9px;
    }
    .you-tile .swatch {
        width: 6px;
        height: 6px;
        margin-right: 4px;
    }
}

.leaderboard-tile {
    position: absolute;
    left: 0;
    right: 0;
    height: 24px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    transition: transform 0.4s ease-out, background 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.leaderboard-tile:hover {
    border-color: #d4d4d4;
}
.leaderboard-tile .rank {
    font-size: 10px;
    color: #6b7280;
    font-weight: 600;
    min-width: 22px;
}
.leaderboard-tile .name {
    font-size: 11px;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
}
.leaderboard-tile .change {
    font-size: 9px;
    font-weight: 500;
    min-width: 24px;
    text-align: right;
}
.leaderboard-tile .change.up {
    color: #10b981;
}
.leaderboard-tile .change.down {
    color: #ef4444;
}
.leaderboard-tile .change.same {
    color: #9ca3af;
}
.leaderboard-swipe-hint {
    text-align: center;
    font-size: 10px;
    color: #9ca3af;
    margin-top: 12px;
    display: none; /* Hidden on desktop */
}
@media (max-width: 768px) {
    .leaderboard-sex-selector {
        display: flex; /* Show on mobile */
    }
    .leaderboard-slider-container {
        width: 85%;
        max-width: 300px;
    }
    .leaderboard-desktop {
        display: none; /* Hide three-column layout on mobile */
    }
    .leaderboard-mobile {
        display: flex; /* Show single-column layout on mobile */
        justify-content: center;
        align-items: center;
        gap: 0;
    }
    .year-nav-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1; /* Fill all whitespace on sides */
        background: transparent;
        border: none;
        font-size: 48px;
        color: #d1d5db;
        cursor: pointer;
        padding: 0;
        min-height: 650px; /* Match grid height for full click area */
        -webkit-tap-highlight-color: transparent; /* Remove blue flicker */
        touch-action: manipulation; /* Prevent double-tap zoom */
    }
    .year-nav-arrow:disabled {
        opacity: 0.15;
        cursor: not-allowed;
    }
    .leaderboard-grid {
        min-width: 160px;
        max-width: 180px;
        padding: 0;
        flex-shrink: 0;
    }
    .leaderboard-tile {
        padding: 4px 8px;
    }
    .leaderboard-swipe-hint {
        display: none; /* Hidden - arrows are obvious */
    }
}

/* Hot Names Tab Styles */
#hot-coming .controls {
    margin-bottom: 12px;
}
.hot-description {
    font-size: 10px;
    color: #9ca3af;
    margin: 0 0 10px 0;
}
.hot-coming-layout {
    display: flex;
    gap: 16px;
    width: 100%;
}
.hot-chart-column {
    flex: 1;
    min-width: 0;
}
.hot-tiles-column {
    width: 280px;
    flex-shrink: 0;
    max-height: 500px;
    overflow-y: auto;
}
#hot-trajectory-chart {
    width: 100%;
    height: 450px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}
#hot-trajectory-chart svg {
    width: 100%;
    height: 100%;
}
.chart-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
}
.chart-header .metric-toggle {
    gap: 4px;
}
.chart-header .metric-button {
    padding: 3px 10px;
    font-size: 10px;
}
.hot-filters {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}
.hot-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}
.hot-filter-row label {
    color: #374151;
    font-weight: 500;
}
.hot-filter-row select {
    padding: 2px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 11px;
    background: #fff;
}
.hot-filter-row .sex-selector {
    gap: 6px;
}
.hot-filter-row .sex-button {
    padding: 2px 8px;
    font-size: 10px;
}
#hot-coming-tiles {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hot-no-results {
    color: #9ca3af;
    font-size: 11px;
    padding: 20px 10px;
    text-align: center;
}
.hot-name-tile {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.hot-name-tile:hover {
    background: #f5f5f5;
    border-color: #d4d4d4;
}
.hot-name-tile.selected {
    background: #f0f9ff;
    border-color: #bae6fd;
    border-left-width: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.hot-tile-name {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
}
.hot-tile-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 10px;
    color: #6b7280;
}
.hot-tile-stats .growth {
    font-weight: 500;
    color: #059669;
}
.hot-tile-stats .peak-mobile {
    display: none;
}
/* Trajectory chart styles */
#hot-trajectory-chart .axis text {
    font-size: 10px;
    fill: #666;
}
#hot-trajectory-chart .axis line,
#hot-trajectory-chart .axis path {
    stroke: #ccc;
}
#hot-trajectory-chart .grid line {
    stroke: #e5e5e5;
    stroke-dasharray: 2,2;
}
#hot-trajectory-chart .line-historical {
    fill: none;
    stroke: #ea580c;
    stroke-width: 2.5;
}
#hot-trajectory-chart .line-predicted {
    fill: none;
    stroke: #ea580c;
    stroke-width: 2.5;
    stroke-dasharray: 6,3;
    opacity: 0.7;
}
#hot-trajectory-chart .prediction-divider {
    stroke: #d1d5db;
    stroke-width: 1;
    stroke-dasharray: 4,4;
}
#hot-trajectory-chart .chart-title {
    font-size: 16px;
    font-weight: 600;
    fill: #1f2937;
}
.unisex-card {
}

/* Mobile layout for hot names */
@media (max-width: 768px) {
    .hot-filters {
        justify-content: center;
        gap: 8px 16px;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
    .hot-filter-row {
        font-size: 10px;
    }
    .hot-filter-row label {
        font-size: 10px;
    }
    .hot-coming-layout {
        flex-direction: row;
        gap: 6px;
    }
    .hot-chart-column {
        flex: 3;
        min-width: 0;
    }
    .hot-tiles-column {
        flex: 1;
        min-width: 0;
        max-height: none;
        overflow-y: auto;
    }
    #hot-coming-tiles {
        flex-direction: column;
        gap: 4px;
    }
    .hot-name-tile {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 5px 6px;
    }
    .hot-tile-name {
        font-size: 11px;
    }
    .hot-tile-stats {
        align-items: flex-start;
        flex-direction: column;
        gap: 1px;
        font-size: 8px;
    }
    .hot-tile-stats .peak-desktop {
        display: none;
    }
    .hot-tile-stats .peak-mobile {
        display: inline;
    }
    #hot-trajectory-chart {
        height: 400px;
    }
}

/* Cold/Ice Names Styles */
.cold-description {
    font-size: 10px;
    color: #9ca3af;
    margin: 0 0 10px 0;
}
.rare-description {
    font-size: 10px;
    color: #9ca3af;
    margin: 0 0 10px 0;
}
.unisex-description {
    font-size: 10px;
    color: #9ca3af;
    margin: 0 0 10px 0;
}
.cold-leaving-layout {
    display: flex;
    gap: 16px;
    width: 100%;
}
.cold-chart-column {
    flex: 1;
    min-width: 0;
}
.cold-tiles-column {
    width: 280px;
    flex-shrink: 0;
    max-height: 500px;
    overflow-y: auto;
}
#cold-trajectory-chart {
    width: 100%;
    height: 450px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}
#cold-trajectory-chart svg {
    width: 100%;
    height: 100%;
}
.cold-filters {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}
.cold-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}
.cold-filter-row label {
    color: #374151;
    font-weight: 500;
}
.cold-filter-row select {
    padding: 2px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 11px;
    background: #fff;
}
.cold-filter-row .sex-selector {
    gap: 6px;
}
.cold-filter-row .sex-button {
    padding: 2px 8px;
    font-size: 10px;
}
#cold-leaving-tiles {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cold-no-results {
    color: #9ca3af;
    font-size: 11px;
    padding: 20px 10px;
    text-align: center;
}
.cold-name-tile {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cold-name-tile:hover {
    background: #f5f5f5;
    border-color: #d4d4d4;
}
.cold-name-tile.selected {
    background: #f0f9ff;
    border-color: #bae6fd;
    border-right-width: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.cold-tile-name {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
}
.cold-tile-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 10px;
    color: #6b7280;
}
.cold-tile-stats .decline {
    font-weight: 500;
    color: #2563eb;
}
.cold-tile-stats .nadir-mobile {
    display: none;
}
/* Cold trajectory chart styles */
#cold-trajectory-chart .axis text {
    font-size: 10px;
    fill: #666;
}
#cold-trajectory-chart .axis line,
#cold-trajectory-chart .axis path {
    stroke: #ccc;
}
#cold-trajectory-chart .grid line {
    stroke: #e5e5e5;
    stroke-dasharray: 2,2;
}
#cold-trajectory-chart .line-historical {
    fill: none;
    stroke: #2563eb;
    stroke-width: 2.5;
}
#cold-trajectory-chart .line-predicted {
    fill: none;
    stroke: #2563eb;
    stroke-width: 2.5;
    stroke-dasharray: 6,3;
    opacity: 0.7;
}
#cold-trajectory-chart .prediction-divider {
    stroke: #d1d5db;
    stroke-width: 1;
    stroke-dasharray: 4,4;
}
#cold-trajectory-chart .chart-title {
    font-size: 16px;
    font-weight: 600;
    fill: #1f2937;
}

/* Mobile layout for cold names */
@media (max-width: 768px) {
    .cold-filters {
        justify-content: center;
        gap: 8px 16px;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
    .cold-filter-row {
        font-size: 10px;
    }
    .cold-filter-row label {
        font-size: 10px;
    }
    .cold-leaving-layout {
        flex-direction: row;
        gap: 6px;
    }
    .cold-chart-column {
        flex: 3;
        min-width: 0;
    }
    .cold-tiles-column {
        flex: 1;
        min-width: 0;
        max-height: none;
        overflow-y: auto;
    }
    #cold-leaving-tiles {
        flex-direction: column;
        gap: 4px;
    }
    .cold-name-tile {
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
        padding: 5px 6px;
    }
    .cold-tile-name {
        font-size: 11px;
    }
    .cold-tile-stats {
        align-items: flex-end;
        flex-direction: column;
        gap: 1px;
        font-size: 8px;
    }
    .cold-tile-stats .nadir-desktop {
        display: none;
    }
    .cold-tile-stats .nadir-mobile {
        display: inline;
    }
    #cold-trajectory-chart {
        height: 400px;
    }
}

/* Blog Sidebar - hidden by default, shown only on wide screens */
.blog-sidebar {
    display: none;
}

@media (min-width: 1200px) {
    .container {
        max-width: 1120px;
    }

    .blog-sidebar {
        display: block;
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 12px;
        align-self: flex-start;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
        border-left: 1px solid #e5e7eb;
        padding: 12px 0 12px 16px;
        margin-left: 16px;
    }

    .blog-sidebar.sidebar-hidden {
        display: none;
    }

    /* When sidebar is hidden (blog tab active), let main content use full width */
    .container.blog-active {
        max-width: 800px;
    }
}

.blog-sidebar-header {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: lowercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-post-item {
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.15s;
}

.sidebar-post-item:last-child {
    border-bottom: none;
}

.sidebar-post-item:hover {
    background: #f9fafb;
    margin: 0 -8px;
    padding: 8px 8px;
    border-radius: 4px;
}

.sidebar-post-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
    margin-bottom: 2px;
}

.sidebar-post-date {
    font-size: 10px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.sidebar-post-preview {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
