/* ═══════════════════════════════════════════
   Try Code — coding workspace
   ═══════════════════════════════════════════ */

.tc-shell {
    min-height: 100vh;
    min-height: 100dvh;
    color: #e2e8f0;
    background:
        radial-gradient(ellipse 80% 50% at 15% -10%, rgba(99, 102, 241, 0.22), transparent 55%),
        radial-gradient(ellipse 60% 40% at 90% 0%, rgba(14, 165, 233, 0.14), transparent 50%),
        radial-gradient(ellipse 70% 50% at 50% 100%, rgba(34, 197, 94, 0.07), transparent 55%),
        #070914;
    display: flex;
    flex-direction: column;
    font-family: "Tajawal", "Cairo", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    position: relative;
    width: 100%;
}

/* Full-width focus page — no sidebar offset from global style.css */
body.try-code-page #root > div:first-child {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

body.try-code-page .rcx-glass-home-back {
    display: inline-flex;
}

body.try-code-page .tc-shell {
    padding-top: calc(52px + env(safe-area-inset-top, 0px));
}

/* ── Boot / loading screen ── */
.tc-boot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #070914;
    color: #e2e8f0;
    overflow: hidden;
    font-family: "Tajawal", "Cairo", Inter, system-ui, sans-serif;
}

.tc-boot--fullscreen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(ellipse 80% 50% at 15% -10%, rgba(99, 102, 241, 0.28), transparent 55%),
        radial-gradient(ellipse 60% 40% at 90% 0%, rgba(14, 165, 233, 0.18), transparent 50%),
        #070914;
}

.tc-boot__glow {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: 0.65;
    pointer-events: none;
}

.tc-boot__inner {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 32px 24px;
    max-width: 340px;
}

.tc-boot__icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(14, 165, 233, 0.22));
    border: 1px solid rgba(99, 102, 241, 0.4);
    font-size: 1.75rem;
    color: #a5b4fc;
    box-shadow: 0 16px 48px rgba(99, 102, 241, 0.25);
    animation: tcBootPulse 2s ease-in-out infinite;
}

.tc-boot__brand {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: linear-gradient(105deg, #fafafa 0%, #a5b4fc 45%, #38bdf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
}

.tc-boot__text {
    margin: 0 0 24px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #94a3b8;
}

.tc-boot__bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    margin-bottom: 18px;
    overflow: hidden;
}

.tc-boot__bar-fill {
    display: block;
    height: 100%;
    width: 42%;
    border-radius: 99px;
    background: linear-gradient(90deg, #6366f1, #0ea5e9);
    animation: tcBootBar 1.25s ease-in-out infinite;
}

.tc-boot__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.tc-boot__dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6366f1;
    opacity: 0.35;
    animation: tcBootDot 1.2s ease-in-out infinite;
}

.tc-boot__dots span:nth-child(2) { animation-delay: 0.15s; background: #818cf8; }
.tc-boot__dots span:nth-child(3) { animation-delay: 0.3s; background: #0ea5e9; }

@keyframes tcBootPulse {
    0%, 100% { transform: translateY(0); box-shadow: 0 16px 48px rgba(99, 102, 241, 0.25); }
    50% { transform: translateY(-5px); box-shadow: 0 22px 56px rgba(99, 102, 241, 0.38); }
}

@keyframes tcBootBar {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

@keyframes tcBootDot {
    0%, 100% { opacity: 0.25; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1); }
}

.tc-shell--ready {
    animation: tcShellFadeIn 0.45s ease-out both;
}

@keyframes tcShellFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .tc-boot__icon,
    .tc-boot__bar-fill,
    .tc-boot__dots span {
        animation: none;
    }
    .tc-shell--ready {
        animation: none;
    }
}

/* ── Gate screens ── */
.tc-gate {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    color: #e2e8f0;
}

.tc-gate__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.tc-gate__card p {
    color: #94a3b8;
    margin: 0;
}

.tc-lock-card {
    width: 100%;
    max-width: 520px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background:
        radial-gradient(800px 400px at 15% 0%, rgba(37, 99, 235, 0.14), transparent 60%),
        rgba(10, 13, 24, 0.92);
    backdrop-filter: blur(16px) saturate(140%);
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.tc-lock-card__icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tc-lock-card h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 12px;
    color: #f1f5f9;
}

.tc-lock-card p {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.65;
    margin: 0 0 28px;
}

/* ── Buttons ── */
.tc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    font-family: inherit;
}

.tc-btn:hover {
    transform: translateY(-1px);
}

.tc-btn--primary {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    box-shadow: 0 14px 40px rgba(37, 99, 235, 0.25);
}

.tc-btn--ghost {
    background: rgba(17, 24, 39, 0.8);
    border-color: #334155;
    color: #e2e8f0;
}

.tc-btn--sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 999px;
}

.tc-btn--code {
    background: rgba(37, 99, 235, 0.16);
    border-color: rgba(99, 102, 241, 0.28);
    color: #93c5fd;
}

.tc-btn--code.is-active {
    background: rgba(99, 102, 241, 0.28);
    border-color: rgba(129, 140, 248, 0.45);
}

.tc-btn--danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(248, 113, 113, 0.28);
    color: #fca5a5;
}

/* ── Page header ── */
.tc-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding: 22px 28px;
    background: rgba(10, 13, 24, 0.55);
    backdrop-filter: blur(14px) saturate(140%);
}

.tc-header__inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.tc-header__title {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.tc-header__title i {
    font-size: 1.75rem;
    background: linear-gradient(135deg, #22c55e, #0ea5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tc-header__sub {
    margin: 6px 0 0;
    font-size: 0.88rem;
    color: #94a3b8;
    font-weight: 400;
}

.tc-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Daily AI code — BAC Tunisia */
.tc-daily {
    margin: 0 auto 20px;
    max-width: 1280px;
    padding: 0 18px;
}

.tc-daily__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.tc-daily__head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tc-daily__head h2 i {
    color: #a78bfa;
}

.tc-daily__sub {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: #94a3b8;
}

.tc-daily__date {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
    font-size: 0.78rem;
    font-weight: 700;
}

.tc-daily__loading {
    text-align: center;
    padding: 24px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.55);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tc-daily__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 900px) {
    .tc-daily__grid { grid-template-columns: 1fr; }
}

.tc-daily-card {
    position: relative;
    text-align: left;
    padding: 18px 16px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(139, 92, 246, 0.08));
    backdrop-filter: blur(12px);
    color: inherit;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.tc-daily-card:hover {
    transform: translateY(-3px);
    border-color: rgba(167, 139, 250, 0.45);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.18);
}

.tc-daily-card__slot {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
}

.tc-daily-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.tc-daily-card__title {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 6px;
    line-height: 1.35;
}

.tc-daily-card__lang {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #22d3ee;
    margin-bottom: 8px;
}

.tc-daily-card__desc {
    margin: 0 0 12px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #94a3b8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tc-daily-card__cta {
    font-size: 0.78rem;
    font-weight: 700;
    color: #a78bfa;
}

.tc-guide-replay {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(168, 85, 247, 0.35);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(236, 72, 153, 0.12));
    color: #e9d5ff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tc-guide-replay:hover {
    border-color: rgba(168, 85, 247, 0.55);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(236, 72, 153, 0.2));
}

.tc-guide-replay:active {
    transform: scale(0.98);
}

.tc-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: 999px;
    color: #93c5fd;
    font-size: 0.85rem;
    font-weight: 700;
}

/* ── Toolbar ── */
.tc-toolbar {
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    padding: 12px 28px;
    background: rgba(10, 13, 24, 0.4);
    backdrop-filter: blur(10px);
}

.tc-toolbar__inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.tc-segment {
    display: flex;
    background: rgba(15, 23, 42, 0.75);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.tc-segment__btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.tc-segment__btn:hover:not(.is-active) {
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.5);
}

.tc-segment__btn.is-active {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.tc-select-wrap {
    position: relative;
}

.tc-select {
    padding: 8px 36px 8px 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.75);
    color: #e2e8f0;
    cursor: pointer;
    appearance: none;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.tc-select:hover,
.tc-select:focus {
    border-color: rgba(99, 102, 241, 0.45);
}

.tc-select-wrap i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #64748b;
    pointer-events: none;
}

/* ── Main layout ── */
.tc-main {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 20px 28px 28px;
    gap: 20px;
}

@media (max-width: 900px) {
    .tc-main {
        flex-direction: column;
        padding: 16px;
    }
}

/* ── Category sidebar ── */
.tc-sidebar {
    width: 260px;
    min-width: 260px;
    background: rgba(10, 13, 24, 0.72);
    backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 16px;
    overflow-y: auto;
    padding: 12px 0;
    max-height: calc(100vh - 220px);
}

@media (max-width: 900px) {
    .tc-sidebar {
        width: 100%;
        min-width: 0;
        max-height: 220px;
    }
}

.tc-sidebar__label {
    padding: 6px 18px 10px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tc-cat-item {
    padding: 11px 18px;
    margin: 2px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #94a3b8;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.tc-cat-item:hover:not(.is-active) {
    background: rgba(51, 65, 85, 0.35);
    color: #e2e8f0;
}

.tc-cat-item.is-active {
    background: rgba(37, 99, 235, 0.14);
    border-color: rgba(99, 102, 241, 0.28);
    color: #f1f5f9;
}

.tc-cat-item__icon {
    font-size: 15px;
    color: #f59e0b;
}

.tc-cat-item.is-active .tc-cat-item__icon {
    color: #60a5fa;
}

.tc-cat-item__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-cat-item__count {
    padding: 2px 8px;
    background: rgba(37, 99, 235, 0.16);
    border-radius: 999px;
    color: #93c5fd;
    font-size: 0.68rem;
    font-weight: 800;
}

/* ── File area ── */
.tc-content {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: auto;
    background: rgba(10, 13, 24, 0.55);
    backdrop-filter: blur(12px) saturate(130%);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 16px;
    padding: 22px;
    min-height: 320px;
}

.tc-hint {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.18);
    font-size: 0.82rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tc-hint i {
    color: #60a5fa;
}

.tc-hint code {
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.6);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
}

.tc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 360px;
    color: #94a3b8;
    text-align: center;
}

.tc-empty__icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.2);
    display: grid;
    place-items: center;
    margin-bottom: 18px;
}

.tc-empty__icon i {
    font-size: 2rem;
    color: #60a5fa;
}

.tc-empty p {
    margin: 0;
    font-weight: 600;
    color: #cbd5e1;
}

.tc-empty small {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #64748b;
}

/* ── File grid ── */
.tc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.tc-file-card {
    display: flex;
    flex-direction: column;
    padding: 18px;
    cursor: pointer;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.12);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.tc-file-card:hover {
    transform: translateY(-4px);
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.tc-file-card__icon-wrap {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.08);
}

.tc-file-card__icon-wrap i {
    font-size: 1.75rem;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.tc-file-card__title {
    text-align: left;
    font-size: 0.88rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.4;
    word-break: break-word;
    margin-bottom: 8px;
    min-height: 38px;
}

.tc-file-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.tc-file-card__id {
    font-size: 0.68rem;
    font-weight: 800;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.28);
    border-radius: 999px;
    padding: 2px 8px;
}

.tc-file-card__link {
    font-size: 0.68rem;
    color: #60a5fa;
    text-decoration: underline;
}

.tc-file-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 8px;
}

.tc-lang-tag {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

/* ── File list ── */
.tc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tc-list-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}

.tc-list-item:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(99, 102, 241, 0.28);
    transform: translateX(4px);
}

.tc-list-item__icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    margin-right: 14px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.08);
}

.tc-list-item__icon i {
    font-size: 1.1rem;
}

.tc-list-item__body {
    flex: 1;
    min-width: 0;
}

.tc-list-item__title {
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-list-item__desc {
    font-size: 0.78rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-list-item__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.tc-list-item__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 14px;
    flex-shrink: 0;
}

.tc-trim-tag {
    color: #94a3b8;
    padding: 4px 10px;
    background: rgba(51, 65, 85, 0.5);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.72rem;
}

/* ── Code preview expand ── */
.tc-code-preview {
    margin-top: 8px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(2, 6, 23, 0.88) 100%);
    color: #e5e7eb;
    padding: 12px;
}

.tc-code-preview__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.tc-code-preview__label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 800;
}

.tc-code-preview pre {
    margin: 0;
    overflow-x: auto;
    white-space: pre;
    font-size: 0.82rem;
    line-height: 1.55;
    font-family: Consolas, Monaco, "Cascadia Code", monospace;
}

/* ── Editor modal ── */
.tc-modal-overlay {
    z-index: 10000;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tc-modal-overlay--mobile {
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
}

.tc-modal {
    width: 100%;
    max-width: 1800px;
    height: 95vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.tc-modal--mobile {
    max-width: 100%;
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.tc-modal__toolbar {
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tc-modal__toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tc-modal__run {
    padding: 8px 16px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: inherit;
    transition: opacity 0.2s;
}

.tc-modal__run:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.tc-modal__run:not(:disabled):hover {
    opacity: 0.92;
}

.tc-modal__tool-btn {
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    font-family: inherit;
}

.tc-modal__tool-btn:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
    color: #f1f5f9;
}

.tc-modal__title {
    font-size: 0.85rem;
    color: #f1f5f9;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.tc-modal__close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
    padding: 0 8px;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.tc-modal__close:hover {
    background: rgba(51, 65, 85, 0.6);
    color: #f1f5f9;
}

.tc-modal__body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.tc-modal__body > * {
    min-height: 0;
    min-width: 0;
}

.tc-modal__body--horizontal {
    flex-direction: row;
}

.tc-modal__body--vertical {
    flex-direction: column;
}

.tc-modal__body--mobile {
    flex-direction: column;
}

.tc-modal__editor-pane {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    min-width: 0;
    background: #1e1e1e;
    border-right: 1px solid rgba(148, 163, 184, 0.1);
}

.tc-modal__editor-slot {
    flex: 1 1 auto;
    min-height: 220px;
    position: relative;
    overflow: hidden;
}

.tc-modal__editor-slot .monaco-editor,
.tc-modal__editor-slot .monaco-editor .overflow-guard {
    border-radius: 0;
}

.tc-modal__editor-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(10, 10, 10, 0.88);
    color: #e5e7eb;
    z-index: 5;
    pointer-events: none;
}

.tc-modal__editor-loading button {
    pointer-events: auto;
}

.tc-modal__code-input {
    width: 100%;
    height: 100%;
    padding: 15px;
    border: none;
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    box-sizing: border-box;
}

.tc-modal__code-input--dark {
    background: #0a0a0a;
    color: #ffffff;
    caret-color: #ffffff;
}

.tc-modal__code-input--light {
    background: #ffffff;
    color: #000000;
    caret-color: #000000;
}

.tc-modal__result-pane {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0f172a;
    min-height: 0;
    min-width: 0;
}

.tc-modal__result-pane--mobile {
    flex: 0 0 45%;
    min-height: 45vh;
}

.tc-modal__result-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: #0b1220;
}

.tc-modal__result-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 14px;
    color: #64748b;
    padding: 24px;
    text-align: center;
}

.tc-modal__result-empty i {
    font-size: 2.5rem;
    opacity: 0.35;
}

.tc-modal__output-block {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 10px;
    overflow: hidden;
    margin: 12px;
}

.tc-modal__output-label {
    padding: 8px 12px;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tc-modal__output-label--ok {
    background: rgba(34, 197, 94, 0.12);
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.tc-modal__output-label--err {
    background: rgba(239, 68, 68, 0.12);
    border-bottom: 1px solid rgba(248, 113, 113, 0.2);
    color: #fca5a5;
}

.tc-modal__output-pre {
    padding: 14px;
    margin: 0;
    overflow: auto;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.tc-modal__output-pre--ok {
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
}

.tc-modal__output-pre--err {
    background: rgba(69, 10, 10, 0.35);
    color: #fecaca;
}

.tc-modal__tab-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.tc-modal__tab-dot--ok { background: #22c55e; }
.tc-modal__tab-dot--err { background: #ef4444; }

.tc-modal__tabs {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    overflow-x: auto;
}

.tc-modal__tab {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.2s;
}

.tc-modal__tab:hover:not(.is-active) {
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.4);
}

.tc-modal__tab.is-active {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
    color: #93c5fd;
}

.tc-modal__preview-frame {
    flex: 1 1 auto;
    min-height: 280px;
    width: 100%;
    border: none;
    background: #ffffff;
}

.tc-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    animation: tc-pulse 1.4s ease-in-out infinite;
}

@keyframes tc-pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}
