#container-dataviz {
    position: relative;
    overflow: hidden;

    font-family: 'neue-haas-grotesk-display', monospace;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    text-rendering: optimizeLegibility;
    font-kerning: normal;
    font-variant-ligatures: common-ligatures;
    font-weight: 400;
    font-size: 16px;

    --color-primary: rgb(241, 222, 205);
    --color-sand-light: rgb(246 238 231);
    --color-dark-sand: rgb(174 145 118);
    --color-text: #3F465A;
}

#interaction-note {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    pointer-events: none;
    font-size: 0.9rem;
    color: var(--color-text);
    background-color: rgba(246, 238, 231, 0.7);
    padding: 8px 20px;
    border-radius: 25px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
    text-align: center;
    max-width: 80%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(174, 145, 118, 0.15);
    letter-spacing: 0.02em;
}

#interaction-note.visible {
    opacity: 1;
}

#interaction-note b {
    font-weight: 600;
    color: var(--color-dark-sand);
}

#ReciTAC-canvas {
    display: block;
}

#ReciTAC-svg {
    position: absolute;
    top: 0;
    left: 0;
}

/* Search Panel Container */
#search-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 250px;
    background-color: rgb(246 238 231 / 95%);
    /* box-shadow: -2px 0px 12px rgba(0, 0, 0, 0.1); */
    transition: transform 0.3s ease-in-out;
    z-index: 10;
    display: flex;
    flex-direction: row;
}

#search-panel:not(.closed) {
    z-index: 15;
}

/* Slide out animation state */
#search-panel.closed {
    transform: translateX(100%);
}

/* Toggle Button Container (Sticks out to the left of the sliding panel) */
#search-toggle-btn {
    position: absolute;
    top: 20px;
    left: -40px; /* Width of the button itself */
    width: 40px;
    height: 40px;
    background-color: rgb(246 238 231 / 95%);
    /* background-color: rgba(255, 255, 255, 0.95); */
    /* box-shadow: -2px 0px 5px rgba(0, 0, 0, 0.1); */
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444;
    z-index: 11;
}

#search-toggle-btn:hover {
    background-color: rgba(236, 225, 216, 0.95);
}

/* Panel Content */
#search-content {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
}

#search-content h3 {
    margin-top: 0;
    font-size: 1.2rem;
    letter-spacing: 0.03em;
    color: var(--color-text);
}

.search-group {
    margin-bottom: 20px;
    position: relative;
}

.search-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 5px;
}

.search-group input {
    width: 100%;
    padding: 8px 30px 8px 12px;
    border: 1px solid rgb(253, 253, 253);
    border-radius: 6px; /* Rounded corners fitting the design */
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.95rem;
    background-color: rgb(253, 253, 253);
}

.search-group input:focus {
    outline: none;
    border: 1.5px solid rgb(232, 219, 209);
}

/* Clear Button for Inputs */
.search-clear-btn {
    position: absolute;
    right: 8px;
    bottom: 6px; /* Positioned relative to the bottom of the group, which is the bottom of the input */
    width: 20px;
    height: 20px;
    color: #999;
    cursor: pointer;
    display: none; /* Show only when input has value */
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: var(--color-dark-sand);
}

.search-clear-btn svg {
    width: 14px;
    height: 14px;
}


/* Autocomplete List */
.autocomplete-list {
    position: absolute;
    top: calc(100% + 2px); /* ensure it stays strictly below the input box */
    left: 0;
    right: 0;
    background-color: white;
    /* border: 1px solid #ccc; */
    border-radius: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 4px 12px rgb(232, 219, 209);
    display: none;
}

.autocomplete-list div {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    background-color: rgb(253, 253, 253);
    /* border-bottom: 1px solid rgb(247, 240, 234) */
}

.autocomplete-list div:last-child {
    border-bottom: none;
}

.autocomplete-list div:hover {
    background-color: rgb(232, 219, 209);
}

.autocomplete-list .story-count {
    font-size: 0.75rem;
    font-weight: 350;
    letter-spacing: 0.04em;
    color: var(--color-dark-sand);
    font-style: italic;
    opacity: 0.9;
    margin-left: 4px;
}

/* Legend Panel Container */
#legend-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 500px;
    background-color: rgb(246 238 231 / 95%);
    transition: transform 0.3s ease-in-out;
    z-index: 10;
    display: flex;
    flex-direction: row;

    & h5 {
        font-weight: 500;
    }
}

#legend-panel:not(.closed) {
    z-index: 15;
}

/* Slide out animation state */
#legend-panel.closed {
    transform: translateX(100%);
}

/* Toggle Button Container */
#legend-toggle-btn {
    position: absolute;
    top: 70px; /* Positioned below the search toggle (20px + 40px + 10px margin) */
    left: -40px; /* Width of the button itself */
    width: 40px;
    height: 40px;
    background-color: rgb(246 238 231 / 95%);
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444;
    transition: background-color 0.2s ease, top 0.3s ease;
    z-index: 11;
}

#legend-toggle-btn:hover {
    background-color: rgba(236, 225, 216, 0.95);
}

/* Icon toggling */
#legend-toggle-btn .icon {
    display: none;
}

#legend-panel.closed #legend-open-icon {
    display: block;
}

#legend-panel:not(.closed) #legend-close-icon {
    display: block;
}

/* Panel Content */
#legend-content {
    padding: 30px;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
}

#legend-content h3 {
    margin-top: 0;
    font-size: 1.4rem;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: 5px;
}

#legend-content h4 {
    margin-top: 0;
    font-size: 0.95rem;
    line-height: 1.3;
    color: var(--color-dark-sand);
    margin-bottom: 15px;
    font-weight: 400;
}

#legend-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #555;
    margin-bottom: 20px;
}

#legend-content .legend-section {
    margin-top: 20px;
}

#legend-content .legend-section h5 {
    font-size: 1rem;
    font-weight: 900;
    color: var(--color-text);
    margin-bottom: 10px;
    margin-top: 2em;
    border-bottom: 1px solid rgba(174, 145, 118, 0.3);
    padding-bottom: 5px;
    letter-spacing: 0.02em;
}

#legend-divisions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.legend-division-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #555;
    width: 100%; /* or flex: 1 1 45% if we want two columns */
}

.legend-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.legend-item {
    display: flex;
    gap: 7px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.legend-icon {
    width: 35px;
    height: auto;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding-top: 2px;
}

#legend-network-img-container {
    border-radius: 10px;
    overflow: hidden;
}

.legend-network-img, .legend-icon-img {
    width: 100%;
    height: auto;
    vertical-align: middle;
}

#legend-section-elements .legend-text p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--color-text);
    margin-top: 0;
    margin-bottom: 0.6em;
}

#legend-panel .highlight {
    font-weight: 500;
}

.legend-small-text {
    font-size: 0.85rem !important;
    margin-bottom: 0 !important;
}

.legend-credit {
    margin-top: 40px;
    /* padding-top: 20px; */
    padding: 20px 30px;
    border-top: 1px solid rgba(174, 145, 118, 0.15);
    font-size: 0.8rem;
    color: #a89b90;
    text-align: center;
    line-height: 1.5;
    font-style: italic;
    font-weight: 350;
    letter-spacing: 0.03em;
}

.legend-credit a {
    color: var(--color-dark-sand);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.legend-credit a:hover {
    text-decoration: underline;
}

/* Info Panel Container */
#info-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 350px; /* Wider than search panel */
    background-color: rgb(246 238 231 / 95%);
    transition: transform 0.3s ease-in-out;
    z-index: 10;
    display: flex;
    flex-direction: row;

    & h5 {
        font-weight: 500;
    }
}

#info-panel:not(.closed) {
    z-index: 15;
}

/* Slide out animation state */
#info-panel.closed {
    transform: translateX(100%);
}

#info-panel.closed #info-toggle-btn:not(.visible) {
    display: none;
}

/* Toggle Button Container */
#info-toggle-btn {
    position: absolute;
    top: 120px; /* Positioned below the legend toggle (70px + 40px + 10px margin) */
    left: -40px; /* Width of the button itself */
    width: 40px;
    height: 40px;
    background-color: rgb(246 238 231 / 95%);
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444;
    transition: opacity 0.3s ease, background-color 0.2s ease, top 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 11;
}

#info-toggle-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

#info-toggle-btn:hover {
    background-color: rgba(236, 225, 216, 0.95);
}

/* Icon toggling */
#info-toggle-btn .icon {
    display: none;
}

#info-panel.closed #info-open-icon {
    display: block;
}

#info-panel:not(.closed) #info-close-icon {
    display: block;
}

/* Panel Content */
#info-content {
    padding: 30px;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Info Panel Typography & Styling */
#info-content .node-type {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--color-dark-sand);
    margin-bottom: 15px; /* Added space between type and years/title */
    text-transform: uppercase;
}

#info-content .story-years {
    font-style: italic;
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 3px;
    opacity: 0.7;
}

#info-content h2 {
    margin-top: 0;
    margin-bottom: 5px; /* Reduced to sit close to chantier-id */
    font-size: 1.4rem;
    line-height: 1.2;
    color: var(--color-text);
}

#info-content h3 {
    margin-top: 0;
    font-size: 1.2rem;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: 15px;
}

#info-content .story-chantier-id {
    font-size: 0.85rem;
    color: var(--color-dark-sand);
    margin-bottom: 15px;
    margin-top: 10px;
    letter-spacing: 0.1em;
    font-weight: 400;
}

#info-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #555;
    margin-bottom: 15px;
}

#info-content .meta-info {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 25px;
    background: rgba(255,255,255,0.6);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(174, 145, 118, 0.1);
    text-align: center; /* Center the hierarchy links */
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

#info-content .hierarchy {
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.3;
}

#info-content .hierarchy .sep {
    color: #aaa;
    margin: 0 4px;
    font-weight: 300;
}

#info-content .hierarchy .info-cluster-label,
#info-content .hierarchy .info-hub-label {
    cursor: pointer;
}

#info-content .hierarchy .info-cluster-label:hover,
#info-content .hierarchy .info-hub-label:hover {
    text-decoration: underline;
}

#info-content h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--color-text);
}

#info-content ul, #legend-content ul {
    margin-top: 0;
    padding-left: 20px;
    margin-bottom: 20px;
}

#info-content ul ul, #legend-content ul ul {
    margin-bottom: 0;
    margin-top: 5px;
}

#info-content li, #legend-content li {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.4;
}

#info-content .read-more-link {
    display: block;
    width: fit-content;
    margin: 10px auto 30px auto;
    padding: 8px 16px;
    background-color: rgb(222, 203, 185);
    color: var(--color-text);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

#info-content .read-more-link:hover {
    background-color: rgb(206, 186, 167);
}

/* Panel Divider */
.panel-divider {
    border: none;
    border-top: 1px solid rgba(174, 145, 118, 0.2);
    margin: 20px 0;
}

/* Co-Leads Styles */
.co-leads-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.co-lead-card {
    background: rgba(255, 255, 255, 0.6);
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(174, 145, 118, 0.1);
}

.co-lead-name {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.co-lead-meta {
    font-size: 0.75rem;
    color: #888;
    font-weight: 350;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    letter-spacing: 0.03em;
    gap: 4px;
}

.co-lead-meta .meta-dot {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1;
}

.co-lead-meta span:first-child {
    font-style: italic;
    color: #777;
}

/* Stacked Bar Chart Styles */
.bar-chart-intro {
    font-size: 0.85rem;
    color: var(--color-text);
    margin-bottom: 15px;
    line-height: 1.5;
    letter-spacing: 0.005em;
    opacity: 0.8;
    /* font-style: italic; */
    font-weight: 400;
}

.chart-title {
    margin-top: 10px !important;
    margin-bottom: 8px !important;
}

.stacked-bar-container {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    height: 20px; 
    width: 100%;
    margin-bottom: 5px;
    gap: 2px;
    position: relative;
    /* overflow is visible by default */
}

/* Base slice for discipline bars */
.stacked-bar-slice {
    height: 16px;
    border-radius: 3.5px;
    /* cursor: pointer; */
    transition: filter 0.2s;
}

.stacked-bar-slice:hover {
    filter: brightness(0.90);
}

/* University Bar Chart Specific Styles */
.univ-stacked-bar-container {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    height: 40px; /* Gives room for the labels above the University bar */
    width: 100%;
    margin-bottom: 32px; /* Added margin to make space for univ-bar-hover-label */
    gap: 2px;
}

.univ-stacked-bar-slice {
    height: 16px;
    border-radius: 5px;
    position: relative; /* This ensures absolute labels center on this specific slice! */
    display: flex;
    justify-content: center;
    transition: filter 0.2s;
}

.univ-stacked-bar-slice:hover {
    filter: brightness(0.92);
}

/* University Chart Top Labels */
.univ-stacked-bar-slice .univ-bar-label {
    position: absolute;
    bottom: 22px; /* Lift label right above the bar */
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #666;
    white-space: nowrap;
    text-align: center;
    pointer-events: none; /* Prevent mouse interactions from stealing hovers */
    /* allow overflow without hiding */
}

/* University Chart Bottom Hover Labels */
.univ-stacked-bar-slice .univ-bar-hover-label {
    position: absolute;
    top: 22px; /* Place below the slice */
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-style: italic;
    font-weight: 350;
    letter-spacing: 0.03em;
    color: #888;
    white-space: nowrap;
    text-align: center;
    opacity: 0;
    pointer-events: none; /* Let hovers pass through */
    transition: opacity 0.1s ease;
}

.univ-stacked-bar-slice:hover .univ-bar-hover-label {
    opacity: 1;
}

/* Shared Tooltip - fixed below the bar chart */
.discipline-tooltip {
    min-height: 2.6em; /* Increased to hold at least two lines comfortably */
    text-align: center;
    color: var(--color-text); /* Matches main text */
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.3;
    opacity: 0;
    transition: opacity 0.1s ease;
    margin-top: 8px;
    word-wrap: break-word;
    padding: 0 10px;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.discipline-tooltip .person-count {
    display: block; /* Ensure it's on a new line */
    font-size: 0.75rem;
    font-style: italic;
    font-weight: 350;
    letter-spacing: 0.03em;
    color: #888;
    margin-top: 2px;
}

.discipline-distribution-wrapper {
    margin-bottom: 25px;
}

/* HTML Tooltip styles */
.recitac-tooltip {
    position: absolute;
    /* pointer-events: none; */
    z-index: 20;
    transition: opacity 0.15s ease-out, transform 0.1s ease-out;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 14px 14px 12px 18px;
    min-width: 150px;
}

.recitac-tooltip.closed {
    opacity: 0;
    visibility: hidden;
}

.recitac-tooltip .tt-fixed-label {
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background-color: var(--color-dark-sand);
    padding: 3px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}

.recitac-tooltip .tt-subtitle {
    font-size: 0.6rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-dark-sand);
    margin-bottom: 4px;
}

.recitac-tooltip .tt-title {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--color-text);
    margin-bottom: 16px;
}

.recitac-tooltip .tt-flex-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.recitac-tooltip .tt-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 3px solid white;
    /* box-shadow: 0 0 0 1px rgba(0,0,0,0.1); */
}

.recitac-tooltip .tt-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.1s ease-in;
}

.recitac-tooltip .tt-disc-div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recitac-tooltip .tt-discipline {
    font-size: 0.85rem;
    letter-spacing: 0.01em;
    line-height: 1.2;
    color: #444;
}

.recitac-tooltip .tt-division {
    font-size: 0.8rem;
    font-weight: 350;
    font-style: italic;
    letter-spacing: 0.05em;
    margin-top: 4px;
    color: #777;
}

.recitac-tooltip .tt-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(215, 192, 170, 0.419);
}

.recitac-tooltip .tt-status {
    font-size: 0.8rem;
    color: #666;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.recitac-tooltip .tt-badge-student {
    background-color: #E6E1DC; /* Subtle background */
    color: var(--color-dark-sand);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

/* Chantier / WP Connections */
.recitac-tooltip .tt-chantier-section {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(215, 192, 170, 0.419);
}

.recitac-tooltip .tt-chantier-header {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-dark-sand);
    margin-bottom: 10px;
}

.recitac-tooltip .tt-cluster-row {
    margin-bottom: 12px;
}

.recitac-tooltip .tt-cluster-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
    cursor: pointer;
}

.recitac-tooltip .tt-cluster-label:hover {
    text-decoration: underline;
}

.recitac-tooltip .tt-hubs-container {
    padding-left: 0;
}

.recitac-tooltip .tt-hub-row {
    font-size: 0.75rem;
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
}

.recitac-tooltip .tt-hub-sep {
    color: var(--color-dark-sand);
    font-weight: 600;
}

.recitac-tooltip .tt-hub-label {
    color: #666;
    cursor: pointer;
}

.recitac-tooltip .tt-hub-label:hover {
    text-decoration: underline;
}

.recitac-tooltip .tt-ids-container {
    display: contents;
}

.recitac-tooltip .tt-chantier-id {
    font-family: monospace;
    font-size: 0.7rem;
    background: rgba(174, 145, 118, 0.1);
    color: var(--color-dark-sand);
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.recitac-tooltip .tt-chantier-id:hover {
    background: rgba(174, 145, 118, 0.25);
}

/* Simple Tooltip */
.recitac-tooltip .tt-simple-type {
    font-size: 0.575rem;
    font-weight: 350;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-dark-sand);
    margin-bottom: 2px;
    margin-top: 2px;
}

.recitac-tooltip .tt-simple-title {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--color-text);
}

.recitac-tooltip.tt-simple {
    text-align: center;
    padding: 6px 10px;
    width: fit-content;
    min-width: 80px;
    max-width: 200px;
    text-wrap: balance;
}

.recitac-tooltip.tt-complex {
    min-width: 250px;
    max-width: 300px;
    width: 280px;
    bottom: 20px;
    right: 20px;
}

/* Direct Link Section in Info Panel */
.direct-link-container {
    margin-top: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    border: 1px dashed rgba(174, 145, 118, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.direct-link-container:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(174, 145, 118, 0.6);
}

.direct-link-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-dark-sand);
    margin-bottom: 8px;
    display: block;
    font-weight: 500;
}

.direct-link-url {
    font-size: 0.8rem;
    color: var(--color-text);
    word-break: break-all;
    font-family: monospace;
    opacity: 0.6;
    line-height: 1.4;
}

.direct-link-copy-feedback {
    display: none;
    font-size: 0.85rem;
    color: #48BB88;
    font-weight: 500;
    padding: 5px 0;
}

.direct-link-container.copied {
    border-style: solid;
    border-color: #48BB88;
    background: rgba(72, 187, 136, 0.05);
}

.direct-link-container.copied .direct-link-copy-feedback {
    display: block;
}

.direct-link-container.copied .direct-link-url,
.direct-link-container.copied .direct-link-label {
    display: none;
}

/* ---------------------------------------------------- */
/* Attached Story Button */
/* ---------------------------------------------------- */

#attached-story-btn {
    position: absolute;
    top: 0; left: 0;
    /* Start slightly offset for the fade-in animation */
    transform: translate(-10px, -10px); 
    display: flex;
    align-items: center;
    background: var(--color-sand-light);
    border-radius: 100px;
    padding: 0;
    text-decoration: none;
    color: var(--color-text);
    box-shadow: 0 2px 8px #decbb9;
    /* box-shadow: 0 2px 8px rgba(0,0,0,0.1); */
    /* border: 1px solid rgba(174, 145, 118, 0.2); */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease, width 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), height 0.4s ease, background-color 0.3s ease;
    overflow: hidden;
    width: auto;
    height: 20px;
    box-sizing: border-box;
    white-space: nowrap;
    z-index: 8;
}

#attached-story-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, 0);
}

#attached-story-btn:hover:not(.no-hover) {
    height: 30px;
    background-color: var(--color-sand-light);
    box-shadow: 0 5px 10px #decbb930;
}

#attached-story-btn .icon-col {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px; /* Start at 20px width */
    height: 100%;
    transition: flex-basis 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#attached-story-btn:hover:not(.no-hover) .icon-col {
    flex-basis: 30px; /* Expand to 30px to match new height */
}

#attached-story-btn .icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    color: rgb(144 104 66);
    /* color: var(--color-dark-sand); */
    transition: width 0.4s ease, height 0.4s ease;
}

#attached-story-btn:hover:not(.no-hover) .icon-wrapper {
    width: 14px;
    height: 14px;
}

#attached-story-btn .text-col {
    flex: 0 0 0px; /* Start collapsed */
    opacity: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    transition: flex-basis 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s ease 0.1s;
}

#attached-story-btn:hover:not(.no-hover) .text-col {
    flex-basis: 130px; /* Animate to specific width */
    opacity: 1;
    padding-right: 16px; /* Right padding inside the expanding part */
}

#attached-story-btn .btn-text {
    font-family: inherit;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--color-text);
    pointer-events: none;
    margin: 0 auto;
}

#attached-story-btn .icon-wrapper svg {
    width: 100%;
    height: 100%;
}

/* Language Toggle Top-Left */
#language-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 20px;
    padding: 6px 12px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.08);
    z-index: 10;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 500;
}

.lang-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    padding: 4px 6px;
    transition: color 0.2s ease;
}

.lang-btn:hover {
    color: #666;
}

.lang-btn.active {
    color: var(--color-text);
    font-weight: 700;
}

.lang-divider {
    color: #ddd;
    margin: 0 4px;
    font-size: 0.8rem;
}
