.tct-tool-wrapper {
    max-width: 920px;
    margin: 40px auto;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.15);
    overflow: hidden;
    position: relative;
}

.tct-tool-wrapper.dark-mode {
    background: #0f172a;
    color: #e2e8f0;
    --accent: #6366f1;
}

.tct-header {
    padding: 24px 32px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.tct-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.tct-dark-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.tct-dark-toggle:hover { background: rgba(255,255,255,0.35); transform: scale(1.05); }

.tct-main {
    padding: 32px;
    display: grid;
    gap: 28px;
}

.tct-input-section textarea,
.tct-output-section textarea {
    width: 100%;
    min-height: 260px;
    padding: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: ui-monospace, monospace;
    font-size: 15px;
    line-height: 1.65;
    resize: vertical;
    transition: all 0.3s;
}

.tct-tool-wrapper.dark-mode .tct-input-section textarea,
.tct-tool-wrapper.dark-mode .tct-output-section textarea {
    background: #1e2937;
    border-color: #334155;
    color: #e2e8f0;
}

.tct-input-section textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.tct-counts {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 8px;
}

.tct-options {
    background: #f8fafc;
    padding: 24px;
    border-radius: 16px;
}

.tct-tool-wrapper.dark-mode .tct-options { background: #1e2937; }

.tct-options label {
    display: block;
    margin-bottom: 14px;
    font-weight: 500;
    cursor: pointer;
}

.tct-options input[type="checkbox"] {
    margin-right: 10px;
    accent-color: #6366f1;
}

.tct-options textarea {
    width: 100%;
    min-height: 90px;
    margin-top: 8px;
}

.tct-btn-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 9999px;
    cursor: pointer;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgb(99 102 241 / 0.3);
}

.tct-btn-primary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 20px 25px -5px rgb(99 102 241 / 0.4);
}

.tct-output-section {
    padding: 0 32px 40px;
}

.tct-output-container {
    display: flex;
    gap: 24px;
    margin-top: 16px;
}

.tct-original,
.tct-cleaned {
    flex: 1;
    min-width: 280px;
}

.tct-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tct-actions {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.tct-actions button {
    flex: 1;
    padding: 14px;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tct-actions button:first-child {
    background: #10b981;
    color: white;
    border: none;
}

.tct-actions button:last-child {
    background: #3b82f6;
    color: white;
    border: none;
}

.tct-tool-wrapper .loading::after {
    content: " ";
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 12px;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
    .tct-output-container { flex-direction: column; }
    .tct-main { padding: 24px; }
}