.stacked-page {
    padding-bottom: 2rem;
    background: #f8fbff;
}

.stacked-hero {
    padding: 3.5rem 1rem 3rem;
    background: linear-gradient(180deg, #eef0ff 0%, #f8fbff 72%, transparent 100%);
}

.stacked-hero-copy {
    width: min(980px, 100%);
    margin: 0 auto;
    text-align: center;
}

.stacked-eyebrow {
    margin: 0 0 .75rem;
    color: #4f46e5;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.stacked-hero .hero-title {
    max-width: 920px;
    margin: 0 auto;
}

.stacked-hero .hero-subtitle {
    max-width: 820px;
    margin: 1rem auto 0;
    line-height: 1.85;
}

.stacked-hero .hero-pills {
    justify-content: center;
}

.stacked-tool-section {
    width: min(1220px, 94vw);
    margin: 0 auto;
}

.stacked-tool-grid {
    align-items: start;
}

.stacked-format-note {
    padding: .85rem 1rem;
    color: #3730a3;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    font-size: .9rem;
    line-height: 1.7;
}

.stacked-title-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(130px, .55fr);
    gap: .8rem;
}

.stacked-editor-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.stacked-subtitle {
    margin: 0;
    color: var(--text-color, #28304d);
    font-size: 1rem;
}

.stacked-editor-heading .data-hint {
    margin-bottom: 0;
}

.stacked-limit-badge {
    flex: 0 0 auto;
    padding: .35rem .55rem;
    border-radius: 999px;
    color: #475569;
    background: #f1f5f9;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}

.stacked-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    background: #fff;
}

.stacked-data-table {
    width: 100%;
    min-width: 660px;
    border-collapse: collapse;
    font-size: .86rem;
}

.stacked-data-table th,
.stacked-data-table td {
    padding: .5rem;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.stacked-data-table thead th {
    color: #475569;
    background: #f8fafc;
    font-size: .78rem;
    text-align: left;
    white-space: nowrap;
}

.stacked-data-table tbody tr:last-child th,
.stacked-data-table tbody tr:last-child td {
    border-bottom: 0;
}

.stacked-data-table tbody th {
    min-width: 128px;
    color: #475569;
    font-weight: 600;
    text-align: left;
}

.stacked-data-table input {
    width: 100%;
    min-height: 42px;
    padding: .5rem .6rem;
    border: 1px solid var(--border-color, #dbe2ea);
    border-radius: 9px;
    background: #fff;
    color: var(--text-color, #28304d);
    font: inherit;
    box-sizing: border-box;
}

.stacked-data-table input:focus {
    outline: 3px solid rgba(79, 70, 229, .18);
    border-color: #6366f1;
}

.stacked-series-heading {
    display: flex;
    min-width: 125px;
    align-items: center;
    gap: .4rem;
}

.stacked-series-heading input {
    min-width: 80px;
    min-height: 34px;
    padding: .35rem .45rem;
    font-size: .8rem;
}

.stacked-color-dot,
.stacked-legend-item i {
    display: inline-block;
    width: .7rem;
    height: .7rem;
    flex: 0 0 .7rem;
    border-radius: 3px;
}

.stacked-remove-series,
.stacked-remove-row {
    display: inline-flex;
    min-width: 34px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    background: #fff7f8;
    color: #be123c;
    cursor: pointer;
    font: inherit;
    font-size: 1.1rem;
    line-height: 1;
}

.stacked-remove-series:hover,
.stacked-remove-series:focus-visible,
.stacked-remove-row:hover,
.stacked-remove-row:focus-visible {
    border-color: #e11d48;
    background: #ffe4e8;
}

.stacked-remove-series:disabled,
.stacked-remove-row:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.stacked-action-column,
.stacked-action-cell {
    width: 52px;
    text-align: center !important;
}

.stacked-editor-actions,
.stacked-download-actions,
.stacked-input-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
}

.stacked-limit-note,
.stacked-live-note {
    margin: 0;
    color: var(--text-secondary, #64748b);
    font-size: .82rem;
    line-height: 1.7;
}

.stacked-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.stacked-choice-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.stacked-choice-btn {
    min-height: 44px;
    padding: .5rem .75rem;
    border: 1px solid #dbe2ea;
    border-radius: 9px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    font: inherit;
    font-size: .84rem;
}

.stacked-choice-btn:hover,
.stacked-choice-btn:focus-visible,
.stacked-choice-btn.active {
    border-color: #6366f1;
    background: #eef2ff;
    color: #3730a3;
}

.stacked-primary-action {
    min-height: 48px;
}

.stacked-error {
    padding: .75rem 1rem;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #991b1b;
    line-height: 1.7;
}

.stacked-error.stacked-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.stacked-result-card {
    min-height: 100%;
}

.stacked-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.stacked-chart-wrap {
    position: relative;
    min-height: 350px;
    margin-top: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 14px;
    background: #fff;
}

.stacked-output-svg {
    display: block;
    width: 100%;
    min-width: 700px;
    height: auto;
}

.stacked-empty-state {
    display: grid;
    min-height: 350px;
    place-items: center;
    padding: 2rem;
    color: var(--text-secondary, #64748b);
    text-align: center;
}

.stacked-empty-state span {
    display: block;
    margin-bottom: .5rem;
    color: #6366f1;
    font-size: 2.4rem;
}

.stacked-empty-state p {
    margin: 0;
    line-height: 1.7;
}

.stacked-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem 1rem;
    margin-top: .8rem;
    color: var(--text-secondary, #64748b);
    font-size: .82rem;
}

.stacked-legend-item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.stacked-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .7rem;
    margin-top: 1rem;
}

.stacked-summary-grid div {
    min-width: 0;
    padding: .8rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    background: #fafafa;
}

.stacked-summary-grid span,
.stacked-summary-grid strong {
    display: block;
}

.stacked-summary-grid span {
    color: var(--text-secondary, #64748b);
    font-size: .78rem;
}

.stacked-summary-grid strong {
    margin-top: .2rem;
    overflow-wrap: anywhere;
    color: #28304d;
    font-size: 1.05rem;
}

.stacked-example-card {
    background: linear-gradient(135deg, rgba(79, 70, 229, .08), rgba(20, 184, 166, .08));
}

.stacked-example-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    color: #3730a3;
    font-size: .9rem;
}

.stacked-example-flow span {
    padding: .45rem .6rem;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    background: #fff;
}

.stacked-example-flow b {
    color: #64748b;
}

.stacked-copy-section {
    width: min(1000px, 94vw);
    margin: 2rem auto 0;
}

.stacked-answer-label {
    margin: 0;
    color: #4f46e5;
    font-weight: 800;
}

.stacked-answer {
    margin: .45rem 0 0;
    font-size: 1.05rem;
    line-height: 1.9;
}

.stacked-paragraph {
    margin: 1rem 0 0;
    line-height: 1.95;
}

.stacked-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.stacked-info-card {
    padding: 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    background: #fff;
}

.stacked-info-card h3 {
    margin: 0;
    color: #28304d;
    font-size: 1rem;
}

.stacked-info-card p {
    margin: .5rem 0 0;
    line-height: 1.78;
}

.stacked-card-example {
    color: #4f46e5;
    font-size: .88rem;
}

.stacked-example-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.stacked-example-button {
    display: flex;
    min-height: 150px;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    background: #fff;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.stacked-example-button:hover,
.stacked-example-button:focus-visible {
    border-color: #818cf8;
    box-shadow: 0 8px 20px rgba(79, 70, 229, .1);
    transform: translateY(-1px);
}

.stacked-example-button-title {
    color: #28304d;
    font-size: 1rem;
    font-weight: 800;
}

.stacked-example-button-desc {
    margin-top: .45rem;
    color: #64748b;
    line-height: 1.7;
}

.stacked-example-button-meta {
    margin-top: auto;
    padding-top: .75rem;
    color: #4f46e5;
    font-size: .8rem;
    font-weight: 700;
}

.stacked-page .comparison-table {
    min-width: 760px;
}

.stacked-page .faq-answer p {
    line-height: 1.85;
}

@media (max-width: 980px) {
    .stacked-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .stacked-hero {
        padding: 2.4rem 1rem 2rem;
    }

    .stacked-title-grid,
    .stacked-option-grid,
    .stacked-example-grid {
        grid-template-columns: 1fr;
    }

    .stacked-editor-heading {
        display: block;
    }

    .stacked-limit-badge {
        display: inline-block;
        margin-top: .55rem;
    }

    .stacked-preview-header {
        display: block;
    }

    .stacked-preview-header .pill {
        display: inline-block;
        margin-top: .6rem;
    }

    .stacked-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .stacked-page *,
    .stacked-page *::before,
    .stacked-page *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
