:root {
    --primary: #d946ef;
    --primary-hover: #e879f9;
    --success: #10b981;
    --text-main: #f9fafb;
    --text-secondary: #9ca3af;
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --border: #334155;
    --amber: #f59e0b;
    --font: 'Inter', system-ui, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    padding: 4rem 2rem 3rem;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Background Animation */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
}

.orb-1 { 
    top:-20%; 
    left:-15%; 
    width:70vw; 
    height:70vw; 
    background: radial-gradient(circle, var(--primary) 0%, transparent 65%); 
    animation: float 28s infinite ease-in-out alternate; 
}

.orb-2 { 
    bottom:-20%; 
    right:-15%; 
    width:60vw; 
    height:60vw; 
    background: radial-gradient(circle, var(--amber) 0%, transparent 65%); 
    animation: float 34s infinite ease-in-out alternate-reverse; 
}

@keyframes float {
    0%   { transform: translate(0,0) scale(1); }
    50%  { transform: translate(4%,5%) scale(1.05); }
    100% { transform: translate(0,0) scale(1); }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
#app-header-section {
    text-align: left;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    width: 100%;
}

.header-content {
    position: relative;
    width: 100%;
}

.app-header-copy {
    flex: 1;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(90deg, #d946ef 0%, #f59e0b 25%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.app-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

.app-header-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.9rem;
}

/* Top Controls - Language Dropdown */
.top-controls {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.top-controls #custom-language-select {
    width: max-content;
    min-width: 180px;
}

.top-controls #custom-language-select .custom-options {
    width: max-content;
    min-width: 100%;
    left: auto;
    right: 0;
}

/* Language Dropdown */
.custom-select-wrapper {
    position: relative;
}

.custom-select-wrapper .selected-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.custom-select-wrapper .selected-option:hover {
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.12);
}

.custom-select-wrapper .option-text {
    white-space: nowrap;
}

.custom-select-wrapper .select-arrow {
    margin-left: auto;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-secondary);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.custom-select-wrapper.open .select-arrow {
    transform: rotate(180deg);
}

.custom-select-wrapper .custom-options {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    padding: 0.5rem;
}

.custom-select-wrapper.open .custom-options {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
}

.custom-select-wrapper .custom-options button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
    white-space: nowrap;
}

.custom-select-wrapper .custom-options button:hover {
    background: rgba(217, 70, 239, 0.14);
}

.custom-select-wrapper .custom-options button.selected {
    background: rgba(217, 70, 239, 0.2);
    font-weight: 600;
}

.language-select.hidden {
    display: none;
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    column-gap: 2rem;
    row-gap: 2rem;
    align-items: flex-start;
}

/* Controls Panel */
.controls-panel {
    position: relative;
    z-index: 10;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    box-shadow: 0 4px 40px -8px rgba(0,0,0,0.6);
}

.controls-panel-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.controls-panel-border path {
    fill: none;
    stroke-width: 2;
}

.controls-panel-border-track {
    stroke: rgba(217, 70, 239, 0.1);
}

.controls-panel-border-wave {
    stroke: var(--primary);
    stroke-dasharray: 20 80;
    stroke-dashoffset: 0;
    animation: controls-panel-wave 10s linear infinite;
    opacity: 0.5;
}

.controls-panel-border-wave-secondary {
    stroke: var(--amber);
    animation-direction: reverse;
    animation-duration: 15s;
}

@keyframes controls-panel-wave {
    to { stroke-dashoffset: -100; }
}

.controls-content {
    position: relative;
    z-index: 1;
}

/* Input Sections */
.input-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 1.5rem 0;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.input-group {
    margin-bottom: 1.25rem;
    width: 100%;
    min-width: 0;
}

.input-row .input-group {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.4rem;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
}

.input-wrapper input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.currency-symbol {
    color: var(--text-secondary);
    padding-left: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
}

.percent-symbol {
    color: var(--text-secondary);
    padding-right: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
}

/* Custom Select Dropdown */
.currency-select-native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-select-value {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
}

.custom-select-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.custom-select-trigger:hover,
.custom-select.open .custom-select-trigger {
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.12);
}

.custom-select-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.custom-select.open .custom-select-chevron {
    transform: rotate(180deg);
}

.custom-select-menu {
    position: fixed;
    width: min(400px, 90vw);
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transform-origin: top;
    display: flex;
    flex-direction: column;
    padding: 0.4rem;
    border-radius: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    transition: max-height 0.3s ease, opacity 0.2s ease, transform 0.2s ease;
}

.custom-select.open .custom-select-menu {
    max-height: 400px !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.custom-select-search-wrapper {
    position: relative;
    margin-bottom: 0.4rem;
    flex-shrink: 0;
}

.custom-select-search {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    outline: none;
}

.custom-select-search:focus {
    border-color: var(--primary);
}

.custom-select-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.custom-select-search-clear:hover {
    color: var(--text-main);
}

.custom-select-options {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.custom-select-options::-webkit-scrollbar {
    width: 6px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: transparent;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.custom-select-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    border-radius: 0.6rem;
    cursor: pointer;
    text-align: left;
    font-size: 0.85rem;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s, border-color 0.2s;
}

.custom-select-option:hover,
.custom-select-option.selected {
    background: rgba(217, 70, 239, 0.14);
    border-color: rgba(232, 121, 249, 0.3);
}

.custom-select-option:hover {
    transform: translateY(-1px);
}

.flag-icon {
    width: 22px;
    height: 22px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(148, 163, 184, 0.12);
}

.flag-icon.is-fallback {
    background: rgba(148, 163, 184, 0.3);
}

.custom-select-option-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.input-group input[type="number"]::-webkit-inner-spin-button,
.input-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.input-group input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Toggle Switch */
.toggle-group {
    margin-bottom: 1rem;
}

.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(148, 163, 184, 0.3);
    transition: 0.3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--primary), var(--amber));
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Contribution Options - styles moved to collapsible section */

.frequency-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.freq-btn {
    flex: 1;
    background: rgba(217, 70, 239, 0.1);
    border: 1px solid rgba(217, 70, 239, 0.2);
    color: var(--primary-hover);
    padding: 0.5rem 0;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.freq-btn:hover {
    background: rgba(217, 70, 239, 0.2);
    border-color: var(--primary-hover);
}

.freq-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Results Panel */
.results-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Summary Card */
.summary-card {
    background: linear-gradient(145deg, rgba(217, 70, 239, 0.15), rgba(15, 23, 42, 0.6));
    border: 1px solid rgba(217, 70, 239, 0.3);
    border-radius: 1.25rem;
    padding: 2rem 1.75rem;
    box-shadow: 0 12px 36px -18px rgba(217, 70, 239, 0.5);
    width: fit-content;
    min-width: min(560px, 100%);
    max-width: min(860px, 100%);
    margin: 0 auto;
}

.summary-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    text-align: center;
}

.summary-main {
    margin-bottom: 1rem;
    text-align: center;
}

.summary-value {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 800;
    color: var(--success);
    line-height: 1.1;
    margin-bottom: 0.5rem;
    word-break: break-word;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.5), 0 0 40px rgba(16, 185, 129, 0.3);
}

.summary-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.summary-tax {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.summary-tax .tax-value {
    color: #ef4444;
    font-weight: 600;
}

.summary-secondary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    gap: 0.25rem;
}

.secondary-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.secondary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.secondary-value {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 700;
    color: var(--success);
    word-break: break-word;
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.4), 0 0 30px rgba(16, 185, 129, 0.2);
}

.secondary-tax {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-left: 0;
}

.secondary-tax .tax-value {
    color: #ef4444;
    font-weight: 600;
}

/* Time Range Selector */
.time-range-selector {
    display: flex;
    background: rgba(15,23,42,0.9);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.25rem;
    gap: 0.25rem;
    position: relative;
    opacity: 1;
    height: auto;
    transform: scaleY(1);
    transform-origin: top;
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), padding 0.8s ease, margin 0.8s ease, border-width 0.8s ease, height 0.8s ease;
    overflow: hidden;
}

.time-range-selector.fade-out {
    opacity: 0;
    transform: scaleY(0);
    padding: 0;
    margin: 0;
    border-width: 0;
    height: 0;
    pointer-events: none;
}

.time-range-selector::before {
    content: '';
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    width: calc(20% - 0.2rem);
    height: calc(100% - 0.5rem);
    background: linear-gradient(135deg, #5a397c 25%, #915c00 );
    border: 2px solid #4a276b;
    border-radius: 0.3rem;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 0;
}

.time-range-selector[data-active="0"]::before { transform: translateX(0); }
.time-range-selector[data-active="1"]::before { transform: translateX(calc(100% + 0.25rem)); }
.time-range-selector[data-active="2"]::before { transform: translateX(calc(200% + 0.5rem)); }
.time-range-selector[data-active="3"]::before { transform: translateX(calc(300% + 0.75rem)); }
.time-range-selector[data-active="4"]::before { transform: translateX(calc(400% + 1rem)); }

.time-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.3rem;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    position: relative;
    z-index: 1;
}

.time-btn:hover:not(.active) {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-main);
}

.time-btn.active {
    color: var(--text-main);
}

/* Charts Container */
.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    gap: 1.5rem;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), grid-template-rows 0.8s cubic-bezier(0.4, 0, 0.2, 1), gap 0.8s ease, margin 0.8s ease, height 0.8s ease;
    overflow: hidden;
}

.charts-container.fade-out {
    opacity: 0;
    transform: translateY(-30px);
    grid-template-rows: 0fr;
    gap: 0;
    margin: 0;
    height: 0;
    pointer-events: none;
}

.chart-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    min-height: 350px;
    overflow: hidden;
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.chart-box canvas {
    width: 100% !important;
    height: 280px !important;
}

/* Chart wrapper to prevent stretching */
.chart-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 300px;
}

.chart-wrapper canvas {
    flex: 0 0 auto;
    height: 100% !important;
}

.pie-chart-box canvas {
    filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.3)) drop-shadow(0 0 30px rgba(234, 179, 8, 0.25));
    transition: filter 0.3s ease;
}

.pie-chart-box canvas:hover {
    filter: drop-shadow(0 0 30px rgba(124, 58, 237, 0.5)) drop-shadow(0 0 40px rgba(234, 179, 8, 0.35));
}

.bar-chart-box canvas {
    filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.3));
}

.pie-chart-box {
    display: grid;
    grid-template-rows: auto auto 1fr;
    flex-direction: column;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), grid-template-rows 0.8s cubic-bezier(0.4, 0, 0.2, 1), padding 0.8s ease, margin 0.8s ease, height 0.8s ease;
    overflow: hidden;
}

.pie-chart-box > * {
    min-height: 0;
}

.pie-chart-box.fade-out {
    opacity: 0;
    transform: scale(0.9);
    grid-template-rows: 0fr 0fr 0fr;
    padding: 0;
    margin: 0;
    border-width: 0;
    height: 0;
    pointer-events: none;
}

.bar-chart-box {
    display: grid;
    grid-template-rows: auto 1fr;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), grid-template-rows 0.8s cubic-bezier(0.4, 0, 0.2, 1), padding 0.8s ease, margin 0.8s ease, height 0.8s ease;
    overflow: hidden;
}

.bar-chart-box > * {
    min-height: 0;
}

.bar-chart-box.fade-out {
    opacity: 0;
    transform: scale(0.9);
    grid-template-rows: 0fr 0fr;
    padding: 0;
    margin: 0;
    border-width: 0;
    height: 0;
    pointer-events: none;
}
/* ─── SITE FOOTER ─────────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 2.5rem 0 0;
    color: var(--text-secondary);
    font-size: 0.825rem;
}

.site-footer a {
    color: var(--primary-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--transition-base);
}

.site-footer a:hover {
    color: #ffffff;
}
/* GitHub CTA Banner */
.gh-cta {
    position: relative;
    margin: 2rem auto 0;
    padding: 2.25rem 2rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(30,41,59,0.97) 0%, rgba(15,23,42,0.99) 100%);
    text-align: center;
    overflow: hidden;
    isolation: isolate;
    width: 100%;
    max-width: 520px;
}

.gh-cta::before {
    content: '';
    position: absolute;
    inset: -1.5px;
    border-radius: calc(1.5rem + 2px);
    background: linear-gradient(90deg, hsl(300,65%,55%), hsl(45,60%,50%), hsl(300,65%,55%));
    background-size: 200% auto;
    animation: animate-rainbow 8s linear infinite;
    z-index: -1;
    opacity: 0.22;
}

@keyframes animate-rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gh-cta::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 50%;
    background: radial-gradient(ellipse, rgba(217, 70, 239, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.gh-cta-inner {
    position: relative;
    z-index: 1;
}

.gh-cta-octocat {
    width: 44px;
    height: 44px;
    color: var(--text-main);
    margin: 0 auto 1rem;
    display: block;
    opacity: 0.9;
    filter: drop-shadow(0 0 12px rgba(217, 70, 239, 0.5));
    transition: filter 0.3s, transform 0.3s;
}

.gh-cta:hover .gh-cta-octocat {
    filter: drop-shadow(0 0 20px rgba(232, 121, 249, 0.8));
    transform: scale(1.08) rotate(-4deg);
}

.gh-cta-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.75rem;
    background: rgba(217, 70, 239, 0.12);
    border: 1px solid rgba(217, 70, 239, 0.25);
    border-radius: 99px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary-hover);
    margin-bottom: 0.75rem;
}

.gh-cta-eyebrow-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary-hover);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

.gh-cta-title {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: #f1f5f9;
    text-shadow: -1px -1px 0 rgba(0,0,0,0.9), 1px -1px 0 rgba(0,0,0,0.9), -1px 1px 0 rgba(0,0,0,0.9), 1px 1px 0 rgba(0,0,0,0.9), 0 0 16px rgba(232, 121, 249, 0.3);
    margin-bottom: 0.65rem;
}

.gh-cta-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.gh-cta-text {
    color: #e2e8f0;
    font-size: 0.92rem;
    line-height: 1.65;
    margin: 0 auto 1.5rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.85);
}

.gh-cta-text strong {
    color: var(--text-main);
    font-weight: 600;
}

/*---------COLLAPSIBLE SECTIONS------------*/

/* Animated panels for optional settings */
.contribution-options {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, opacity 0.4s ease-in-out, margin 0.4s ease;
    margin-top: 0;
}

.contribution-options.expanded {
    max-height: 1000px;
    opacity: 1;
    margin-top: 1rem;
    overflow: visible;
}

/*---------UTILITY CLASSES------------*/

.hidden {
    display: none !important;
}

/*---------CHART SUBTITLE------------*/

.chart-subtitle {
    font-size: 0.875rem;
    color: #9ca3af;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.chart-subtitle:last-of-type {
    margin-bottom: 1rem;
}

/* Label spans inherit the gray parent color */
.chart-subtitle span {
    color: inherit;
    font-weight: inherit;
}

/* Only the value spans get the green accent */
#portfolio-value,
#portfolio-dividend-value {
    color: #10b981;
    font-weight: 600;
}

.chart-subtitle .tax-value {
    color: #ef4444;
    font-weight: 600;
}

.gh-cta .github-btn {
    height: 2.65rem;
    padding: 0 1.4rem;
    font-size: 0.9rem;
}

/*---------KPI GRID SECTION------------*/

.kpi-grid-section {
    margin: 3rem 0 2rem;
    padding: 0;
    transition: margin-top 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-grid-section.move-up {
    margin-top: 0;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.kpi-card {
    position: relative;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(217, 70, 239, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    backdrop-filter: blur(10px);
    animation: kpi-fade-in 0.5s ease-out backwards;
}

@keyframes kpi-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.1s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.2s; }
.kpi-card:nth-child(5) { animation-delay: 0.25s; }

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--amber));
    opacity: 0.6;
    transition: opacity 0.3s, height 0.3s;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(217, 70, 239, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.kpi-card:hover {
    transform: translateY(-4px);
    border-color: rgba(217, 70, 239, 0.3);
    box-shadow: 0 12px 40px rgba(217, 70, 239, 0.25), 0 0 0 1px rgba(217, 70, 239, 0.2);
}

.kpi-card:hover::before {
    opacity: 1;
    height: 4px;
}

.kpi-card:hover::after {
    opacity: 1;
}

.kpi-card.hidden {
    display: none;
}

.kpi-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.kpi-icon {
    width: 32px;
    height: 32px;
    padding: 6px;
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.15), rgba(245, 158, 11, 0.15));
    border: 1px solid rgba(217, 70, 239, 0.25);
    border-radius: 0.625rem;
    color: var(--primary-hover);
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(217, 70, 239, 0.3));
    transition: all 0.3s;
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.1) rotate(-5deg);
    filter: drop-shadow(0 0 16px rgba(217, 70, 239, 0.5));
}

.kpi-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.kpi-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.kpi-stat {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 0.625rem;
    border: 1px solid rgba(148, 163, 184, 0.08);
    transition: all 0.2s;
}

.kpi-stat:hover {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    transform: translateX(2px);
}

.kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.9;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.kpi-value.kpi-highlight {
    background: linear-gradient(135deg, #10b981, #059669);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 16px rgba(16, 185, 129, 0.4));
}

.kpi-value.kpi-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.4));
}

/* Responsive */
@media (max-width: 1200px) {
    .calculator-grid {
        grid-template-columns: 350px 1fr;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-panel {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .top-controls {
        position: static;
        align-items: flex-start;
        margin-top: 1rem;
    }
    
    .app-header-actions {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 2rem 1rem 2rem;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .app-description {
        font-size: 1rem;
    }
    
    .controls-panel {
        padding: 1.5rem 1rem;
    }
    
    .input-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .input-row .input-group {
        margin-bottom: 0;
    }
    
    .summary-card {
        padding: 1.5rem 1.25rem;
        min-width: 100%;
    }
    
    .summary-value {
        font-size: clamp(1.6rem, 8vw, 2.2rem);
    }
    
    .secondary-value {
        font-size: clamp(0.95rem, 4vw, 1.1rem);
    }
    
    .chart-box {
        padding: 1rem;
        min-height: 300px;
    }
    
    .chart-wrapper {
        height: 220px;
    }
    
    .chart-box canvas {
        height: 220px !important;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .kpi-card {
        padding: 1.5rem;
    }
    
    .kpi-icon {
        width: 28px;
        height: 28px;
        padding: 5px;
    }
    
    .kpi-title {
        font-size: 0.875rem;
    }
    
    .kpi-value {
        font-size: 1.3rem;
    }
    
    .kpi-stat {
        padding: 0.625rem;
    }
    
    .kpi-content {
        gap: 1rem;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   MULTI-STOCK PORTFOLIO FEATURE
   ───────────────────────────────────────────────────────────────────────── */

/* Section wrapper below Strategy Settings */
.additional-stocks-section {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* "+ Add Additional Stock" button */
#add-stock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: rgba(30, 41, 59, 0.55);
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.25s ease;
}

#add-stock-btn:hover {
    background: rgba(217, 70, 239, 0.08);
    border-color: rgba(217, 70, 239, 0.4);
    border-style: solid;
    color: var(--primary-hover);
    box-shadow: 0 0 0 2px rgba(217, 70, 239, 0.08);
}

#add-stock-btn svg {
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

#add-stock-btn:hover svg {
    transform: rotate(90deg);
}

/* Container for dynamically added cards */
#additional-stocks-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Individual stock card */
@keyframes stock-card-in {
    from {
        opacity: 0;
        transform: translateY(-12px) scaleY(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

.additional-stock-card {
    position: relative;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(217, 70, 239, 0.2);
    border-radius: 0.875rem;
    padding: 1.125rem 1rem 1rem;
    animation: stock-card-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
    transform-origin: top center;
    overflow: hidden;
}

.additional-stock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--amber));
    opacity: 0.5;
}

/* Card header row: label field + X button */
.stock-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}

.stock-name-input {
    flex: 1;
    min-width: 0;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.65rem;
    outline: none;
    transition: border-color 0.2s;
}

.stock-name-input::placeholder {
    color: var(--text-secondary);
    font-weight: 500;
}

.stock-name-input:focus {
    border-color: var(--primary);
}

/* Remove (×) button */
.stock-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 50%;
    color: #ef4444;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    font-family: var(--font);
}

.stock-remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: scale(1.1);
}

/* Linked inputs indicator (dividend ↔ yield) */
.linked-inputs-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem;
    align-items: end;
    margin-bottom: 0;
}

.linked-inputs-divider {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.55rem;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

/* Additional stock card input group has less bottom margin */
.additional-stock-card .input-group {
    margin-bottom: 0.75rem;
}

.additional-stock-card .input-group:last-child {
    margin-bottom: 0;
}

.additional-stock-card label {
    font-size: 0.72rem;
}

.additional-stock-card .input-wrapper input {
    font-size: 0.9rem;
}

/* Stock number badge in card header */
.stock-number-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    opacity: 0.85;
}

/* ─── Wide KPI card (Stock Breakdown) ────────────────────────────────────── */

.kpi-card--wide {
    grid-column: 1 / -1;  /* spans full width of kpi-grid */
}

/* Breakdown table inside KPI card */
.stock-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font);
    font-size: 0.82rem;
}

.stock-breakdown-table thead tr {
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.stock-breakdown-table th {
    padding: 0.4rem 0.65rem;
    text-align: left;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stock-breakdown-table td {
    padding: 0.55rem 0.65rem;
    color: var(--text-main);
    font-weight: 500;
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}

.stock-breakdown-table tbody tr:last-child td {
    border-bottom: none;
}

.stock-breakdown-table tbody tr:hover td {
    background: rgba(217, 70, 239, 0.05);
}

.sbt-name {
    font-weight: 700;
    color: var(--primary-hover);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sbt-annual {
    color: #10b981;
    font-weight: 700;
}

.sbt-monthly {
    color: var(--text-main);
    font-weight: 600;
}

.sbt-tax {
    color: #ef4444;
    font-weight: 600;
}

/* Breakdown card content override – no gap needed for table */
#kpi-breakdown-body.kpi-content {
    gap: 0;
    overflow-x: auto;
}

/* Responsive tweaks for new elements */
@media (max-width: 900px) {
    .linked-inputs-row {
        grid-template-columns: 1fr;
    }
    
    .linked-inputs-divider {
        display: none;
    }
    
    .additional-stock-card .input-group:last-of-type {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .linked-inputs-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .linked-inputs-divider {
        display: none;
    }
    
    .stock-breakdown-table th,
    .stock-breakdown-table td {
        padding: 0.4rem 0.4rem;
        font-size: 0.75rem;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   ACTION BAR — Share / Save HTML / Export Table
   ───────────────────────────────────────────────────────────────────────── */

.action-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.625rem;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s ease;
    white-space: nowrap;
}

.action-btn:hover {
    background: rgba(217, 70, 239, 0.1);
    border-color: rgba(217, 70, 239, 0.4);
    color: var(--primary-hover);
    box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.08), 0 4px 16px rgba(0,0,0,0.2);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn-icon {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.action-btn:hover .action-btn-icon {
    transform: scale(1.15);
}

/* ✓ Copied! success state */
.action-btn.btn-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

/* ─────────────────────────────────────────────────────────────────────────
   MODAL — Overlay & Card
   ───────────────────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    position: relative;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.99));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.25rem;
    padding: 2rem;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(217, 70, 239, 0.08);
    transform: translateY(16px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-overlay.open .modal-card {
    transform: translateY(0) scale(1);
}

.modal-card--narrow {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.3rem;
    border-radius: 0.375rem;
    transition: color 0.2s, background 0.2s;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ─── Export Format Cards ────────────────────────────────────────────────── */

.export-format-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.export-format-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 1.25rem 1.1rem 1.25rem 1.35rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 0.875rem;
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    font-family: var(--font);
    transition: all 0.22s ease;
}

.export-format-card:hover {
    border-color: rgba(217, 70, 239, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Colored left accent bar */
.efc-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 0.875rem 0 0 0.875rem;
}

.efc-accent--green { background: linear-gradient(180deg, #10b981, #059669); }
.efc-accent--blue  { background: linear-gradient(180deg, #3b82f6, #2563eb); }

#export-xlsx-btn:hover { border-color: rgba(16, 185, 129, 0.4); box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15); }
#export-csv-btn:hover  { border-color: rgba(59, 130, 246, 0.4); box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15); }

.efc-icon {
    font-size: 1.6rem;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.efc-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.efc-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ─── Share Fallback ─────────────────────────────────────────────────────── */

.share-fallback-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.share-fallback-input {
    flex: 1;
    min-width: 0;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 0.78rem;
    padding: 0.55rem 0.75rem;
    outline: none;
}

.share-fallback-input:focus {
    border-color: var(--primary);
}

.share-copy-btn {
    flex-shrink: 0;
    padding: 0.55rem 1rem;
    background: var(--primary);
    border: none;
    border-radius: 0.5rem;
    color: #fff;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.share-copy-btn:hover {
    background: var(--primary-hover);
}

/* ─── Mobile responsiveness ──────────────────────────────────────────────── */

@media (max-width: 600px) {
    .action-btn .action-btn-label {
        display: none;  /* icon-only on small screens */
    }

    .action-btn {
        padding: 0.55rem 0.7rem;
    }

    .export-format-grid {
        grid-template-columns: 1fr;
    }

    .action-bar {
        justify-content: flex-start;
    }
}
