.library-link-widget {
    margin: 1.5rem 0;
    padding: 1.2rem;
    border-radius: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.ll-toolbar,
.ll-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.ll-mode-btn,
.ll-controls button {
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    font-weight: 700;
    cursor: pointer;
    background: white;
    color: #334155;
    border: 1px solid #cbd5e1;
    transition: all 0.2s ease;
}

.ll-mode-btn:hover,
.ll-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.ll-mode-btn.active {
    background: #0f172a;
    color: white;
    border-color: #0f172a;
}

.ll-stage {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 1rem;
    align-items: center;
    margin: 1.2rem 0;
}

.ll-apps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.ll-app,
.ll-shared-library,
.ll-feedback-card,
.ll-message {
    border-radius: 20px;
    padding: 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.ll-app {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    align-items: stretch;
}

.ll-app strong,
.ll-shared-library strong {
    color: #0f172a;
}

.ll-code-block,
.ll-routine-copy {
    display: block;
    padding: 0.45rem 0.6rem;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
}

.ll-code-block {
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
}

.ll-routine-copy {
    background: #faf5ff;
    color: #581c87;
    border: 1px solid #e9d5ff;
}

.ll-shared-library {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #14532d;
    opacity: 0.45;
    transform: scale(0.96);
    transition: all 0.25s ease;
}

.library-link-widget.dynamic .ll-routine-copy {
    display: none;
}

.library-link-widget.dynamic .ll-shared-library {
    opacity: 1;
    transform: scale(1);
}

.library-link-widget.running .ll-app {
    outline: 3px solid rgba(91, 95, 168, 0.28);
}

.library-link-widget.updated .ll-shared-library {
    background: #ecfeff;
    border-color: #67e8f9;
    color: #164e63;
}

.library-link-widget.problem .ll-shared-library {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #7c2d12;
}

.library-link-widget.problem.dynamic .ll-app {
    outline: 3px solid rgba(234, 88, 12, 0.25);
}

.ll-feedback-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    margin-top: 1rem;
}

.ll-feedback-card strong {
    display: block;
    margin-bottom: 0.4rem;
    color: #0f172a;
}

.ll-feedback-card span {
    color: #475569;
    font-size: 0.92rem;
}

.ll-message {
    margin-top: 1rem;
    background: #fff;
    color: #334155;
    font-weight: 700;
}

@media (max-width: 800px) {
    .ll-stage,
    .ll-feedback-grid {
        grid-template-columns: 1fr;
    }

    .ll-apps {
        grid-template-columns: 1fr;
    }
}
