.yt-section {
    margin: 0 0 1.1rem;
}

.yt-section-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .2rem .65rem;
}

.yt-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: .6rem;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.yt-section-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -.01em;
}

.yt-section-count {
    font-size: .74rem;
    color: #9ca3af;
    font-weight: 500;
    margin-left: auto;
    padding-right: .2rem;
}

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

@media (min-width: 480px) {
    .yt-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .yt-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .yt-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.yt-card {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .95rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .9rem;
    text-decoration: none;
    color: inherit;
    transition: transform .2s ease;
    -webkit-tap-highlight-color: transparent;
}

.yt-card:hover {
    transform: translateY(-2px);
}

.yt-card:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.yt-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: .7rem;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.yt-card-body {
    flex: 1;
    min-width: 0;
}

.yt-card-name {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .92rem;
    font-weight: 700;
    color: #1f2937;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.yt-card-name i {
    font-size: .85rem;
    color: #cbd5e1;
    flex-shrink: 0;
}

.yt-card-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-top: .2rem;
    font-size: .78rem;
    color: #6b7280;
    line-height: 1.55;
}

.yt-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem 1rem;
    color: #6b7280;
}

.yt-state[hidden] {
    display: none !important;
}

.yt-state > i {
    font-size: 2.8rem;
    color: #d1d5db;
    margin-bottom: .8rem;
}

.yt-state h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: .35rem;
}

.yt-state p {
    font-size: .84rem;
    margin-bottom: 1.1rem;
}

.yt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .52rem 1.15rem;
    border: none;
    border-radius: .6rem;
    background: #4f46e5;
    color: #fff;
    font-size: .84rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .2s, transform .15s, box-shadow .2s;
    -webkit-tap-highlight-color: transparent;
}

.yt-btn:hover {
    background: #4338ca;
    box-shadow: 0 3px 10px rgba(79, 70, 229, .28);
}

.yt-btn:active {
    transform: scale(.96);
}

.yt-btn.ghost {
    background: #f3f4f6;
    color: #4b5563;
}

.yt-btn.ghost:hover {
    background: #eef2ff;
    color: #4f46e5;
    box-shadow: none;
}

.yt-btn.danger {
    background: #fef2f2;
    color: #dc2626;
}

.yt-btn.danger:hover {
    background: #fee2e2;
    color: #b91c1c;
    box-shadow: none;
}

.yt-btn.small {
    padding: .32rem .7rem;
    font-size: .76rem;
    border-radius: .5rem;
}

.yt-tool {
    max-width: 76rem;
    margin: 0 auto;
    padding: .9rem 0 1.5rem;
}

.yt-tool-head {
    display: flex;
    align-items: center;
    gap: .9rem;
    flex-wrap: wrap;
    padding: .35rem 0 1rem;
}

.yt-tool-back {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .45rem .85rem;
    border-radius: .6rem;
    background: #f3f4f6;
    color: #4b5563;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .2s, color .2s;
    -webkit-tap-highlight-color: transparent;
}

.yt-tool-back:hover {
    background: #eef2ff;
    color: #4f46e5;
}

.yt-tool-title {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
    flex: 1 1 16rem;
}

.yt-tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: .8rem;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
}

.yt-tool-heading {
    min-width: 0;
}

.yt-tool-name {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -.01em;
    line-height: 1.3;
}

.yt-tool-sub {
    margin: .1rem 0 0;
    font-size: .78rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yt-tool-badge {
    padding: .28rem .75rem;
    border-radius: 999px;
    background: #eef2ff;
    border: 1px solid #e0e7ff;
    color: #4f46e5;
    font-size: .74rem;
    font-weight: 600;
    white-space: nowrap;
}

.yt-tool-panels {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: .85rem;
}

@media (min-width: 900px) {
    .yt-tool-panels {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

.yt-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.1rem 1.15rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    min-width: 0;
}

.yt-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    flex-wrap: wrap;
}

.yt-panel-title {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0 0 .75rem;
    font-size: .88rem;
    font-weight: 700;
    color: #374151;
}

.yt-panel-title i {
    color: #6366f1;
    font-size: 1rem;
}

.yt-panel-head .yt-panel-title {
    margin-bottom: 0;
}

.yt-panel-head+.yt-pre,
.yt-panel-head+* {
    margin-top: .75rem;
}

.yt-field {
    width: 100%;
    padding: .58rem .8rem;
    border: 1px solid #e5e7eb;
    border-radius: .6rem;
    background: #f9fafb;
    color: #111827;
    font-size: .86rem;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.yt-field-area {
    min-height: 8.5rem;
    resize: vertical;
    line-height: 1.6;
}

.yt-field-auto {
    width: auto;
    min-width: 7rem;
}

.yt-field-grow {
    flex: 1 1 12rem;
    min-width: 0;
}

.yt-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.yt-field:focus {
    border-color: #a5b4fc;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.yt-row {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    align-items: center;
    margin-top: .75rem;
}

.yt-label {
    font-size: .8rem;
    font-weight: 600;
    color: #4b5563;
}

.yt-check {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    margin-top: .75rem;
}

.yt-check input {
    accent-color: #4f46e5;
    width: 15px;
    height: 15px;
}

.yt-note {
    display: none;
    align-items: flex-start;
    gap: .4rem;
    margin-top: .7rem;
    padding: .55rem .8rem;
    border-radius: .6rem;
    font-size: .8rem;
    font-weight: 500;
    word-break: break-word;
}

.yt-note.show {
    display: flex;
}

.yt-note.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.yt-note.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.yt-note i {
    font-size: 1rem;
    flex-shrink: 0;
}

.yt-pre {
    margin: 0;
    padding: .85rem 1rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: .7rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .8rem;
    line-height: 1.65;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 24rem;
    overflow-y: auto;
}

.yt-pre.empty {
    color: #9ca3af;
}

.yt-pre.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.yt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .7rem;
}

.yt-chips:empty {
    display: none;
}

.yt-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .24rem .65rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: .72rem;
    font-weight: 500;
}

.yt-chip b {
    color: #4f46e5;
}

.yt-copyline {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .8rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: .6rem;
}

.yt-copyline+.yt-copyline {
    margin-top: .5rem;
}

.yt-copyline-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .76rem;
    font-weight: 700;
    color: #4b5563;
    flex-shrink: 0;
    min-width: 5.4rem;
}

.yt-copyline-label i {
    color: #6366f1;
}

.yt-copyline-value {
    flex: 1;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .76rem;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

.yt-tool-foot {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    margin: .9rem 0 0;
    font-size: .76rem;
    color: #9ca3af;
    line-height: 1.6;
}

.yt-tool-foot i {
    font-size: .88rem;
    margin-top: .12rem;
    flex-shrink: 0;
    color: #f59e0b;
}

.yt-skel {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: yt-skeleton 1.5s ease-in-out infinite;
    border-radius: .4rem;
    display: inline-block;
}

@keyframes yt-skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

html.dark .yt-tool-badge {
    background: rgba(99, 102, 241, .16);
    border-color: rgba(129, 140, 248, .3);
    color: #a5b4fc;
}

html.dark .yt-tool-name {
    color: #f1f5f9;
}

html.dark .yt-tool-sub {
    color: #94a3b8;
}

html.dark .yt-section-icon {
    background: rgba(99, 102, 241, .16);
    color: #a5b4fc;
}

html.dark .yt-section-title {
    color: #e6edf9;
}

html.dark .yt-section-count {
    color: #71839d;
}

html.dark .yt-card {
    background: #101a2e;
    border-color: #24314e;
}

html.dark .yt-card-icon {
    background: rgba(99, 102, 241, .16);
    color: #a5b4fc;
}

html.dark .yt-card-name {
    color: #e6edf9;
}

html.dark .yt-card-desc {
    color: #94a3b8;
}

html.dark .yt-state h2 {
    color: #cbd5e1;
}

html.dark .yt-state > i {
    color: #3b4e74;
}

html.dark .yt-btn {
    background: #6366f1;
}

html.dark .yt-btn:hover {
    background: #4f46e5;
}

html.dark .yt-btn.ghost {
    background: #1c2942;
    color: #a8b6cc;
}

html.dark .yt-btn.ghost:hover {
    background: rgba(99, 102, 241, .2);
    color: #c7d2fe;
}

html.dark .yt-btn.danger {
    background: rgba(239, 68, 68, .12);
    color: #f87171;
}

html.dark .yt-btn.danger:hover {
    background: rgba(239, 68, 68, .22);
    color: #fca5a5;
}

html.dark .yt-tool-back {
    background: #162136;
    color: #a8b6cc;
}

html.dark .yt-tool-back:hover {
    background: rgba(99, 102, 241, .18);
    color: #c7d2fe;
}

html.dark .yt-tool-icon {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}

html.dark .yt-panel {
    background: #101a2e;
    border-color: #24314e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

html.dark .yt-panel-title,
html.dark .yt-label,
html.dark .yt-check {
    color: #cbd5e1;
}

html.dark .yt-field {
    background: #0f172a;
    border-color: #334155;
    color: #e6edf9;
}

html.dark .yt-field:focus {
    border-color: #818cf8;
    background: #0f172a;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, .15);
}

html.dark .yt-note.error {
    background: rgba(127, 29, 29, .2);
    border-color: rgba(153, 27, 27, .5);
    color: #fca5a5;
}

html.dark .yt-note.success {
    background: rgba(6, 78, 59, .3);
    border-color: rgba(6, 95, 70, .6);
    color: #4ade80;
}

html.dark .yt-pre {
    background: #0f172a;
    border-color: #24314e;
    color: #cbd5e1;
}

html.dark .yt-pre.error {
    background: rgba(127, 29, 29, .2);
    border-color: rgba(153, 27, 27, .5);
    color: #fca5a5;
}

html.dark .yt-chip {
    background: #162136;
    color: #94a3b8;
}

html.dark .yt-copyline {
    background: #0f172a;
    border-color: #24314e;
}

html.dark .yt-copyline-label {
    color: #94a3b8;
}

html.dark .yt-copyline-value {
    color: #a8b6cc;
}

html.dark .yt-skel {
    background: linear-gradient(90deg, #162136 25%, #1c2942 50%, #162136 75%);
    background-size: 200% 100%;
}

@media (max-width: 575px) {
    .yt-tool-head {
        align-items: flex-start;
    }

    .yt-tool-title {
        order: -1;
        width: 100%;
        flex: none;
    }

    .yt-tool-back {
        order: 1;
    }

    .yt-tool-badge {
        order: 2;
        margin-left: auto;
    }

    .yt-copyline {
        flex-wrap: wrap;
    }

    .yt-copyline-value {
        flex-basis: 100%;
        order: 3;
        text-align: left;
        white-space: normal;
        word-break: break-all;
    }

    .yt-copyline .yt-btn {
        order: 2;
        margin-left: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .yt-skel {
        animation: none;
        background: #ebebeb;
    }

    .yt-card,
    .yt-card-icon,
    .yt-btn {
        transition: none;
    }
}
